Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
8e32b1f0
Commit
8e32b1f0
authored
Feb 24, 2015
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libavformat: Use ffio_free_dyn_buf where applicable
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
199fb402
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
16 additions
and
36 deletions
+16
-36
dashenc.c
libavformat/dashenc.c
+1
-2
id3v2.c
libavformat/id3v2.c
+4
-4
movenchint.c
libavformat/movenchint.c
+1
-3
mpegtsenc.c
libavformat/mpegtsenc.c
+2
-3
nutenc.c
libavformat/nutenc.c
+3
-8
rtpenc_chain.c
libavformat/rtpenc_chain.c
+1
-3
rtpenc_mpegts.c
libavformat/rtpenc_mpegts.c
+3
-10
rtsp.c
libavformat/rtsp.c
+1
-3
No files found.
libavformat/dashenc.c
View file @
8e32b1f0
...
@@ -155,8 +155,7 @@ static void set_codec_str(AVFormatContext *s, AVCodecContext *codec,
...
@@ -155,8 +155,7 @@ static void set_codec_str(AVFormatContext *s, AVCodecContext *codec,
if
(
avio_open_dyn_buf
(
&
pb
)
<
0
)
if
(
avio_open_dyn_buf
(
&
pb
)
<
0
)
return
;
return
;
if
(
ff_isom_write_avcc
(
pb
,
extradata
,
extradata_size
)
<
0
)
{
if
(
ff_isom_write_avcc
(
pb
,
extradata
,
extradata_size
)
<
0
)
{
avio_close_dyn_buf
(
pb
,
&
tmpbuf
);
ffio_free_dyn_buf
(
&
pb
);
av_free
(
tmpbuf
);
return
;
return
;
}
}
extradata_size
=
avio_close_dyn_buf
(
pb
,
&
extradata
);
extradata_size
=
avio_close_dyn_buf
(
pb
,
&
extradata
);
...
...
libavformat/id3v2.c
View file @
8e32b1f0
...
@@ -207,8 +207,8 @@ static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
...
@@ -207,8 +207,8 @@ static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
case
ID3v2_ENCODING_UTF16BOM
:
case
ID3v2_ENCODING_UTF16BOM
:
if
((
left
-=
2
)
<
0
)
{
if
((
left
-=
2
)
<
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Cannot read BOM value, input too short
\n
"
);
av_log
(
s
,
AV_LOG_ERROR
,
"Cannot read BOM value, input too short
\n
"
);
avio_close_dyn_buf
(
dynbuf
,
dst
);
ffio_free_dyn_buf
(
&
dynbuf
);
av_freep
(
dst
)
;
*
dst
=
NULL
;
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
switch
(
avio_rb16
(
pb
))
{
switch
(
avio_rb16
(
pb
))
{
...
@@ -218,8 +218,8 @@ static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
...
@@ -218,8 +218,8 @@ static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
break
;
break
;
default:
default:
av_log
(
s
,
AV_LOG_ERROR
,
"Incorrect BOM value
\n
"
);
av_log
(
s
,
AV_LOG_ERROR
,
"Incorrect BOM value
\n
"
);
avio_close_dyn_buf
(
dynbuf
,
dst
);
ffio_free_dyn_buf
(
&
dynbuf
);
av_freep
(
dst
)
;
*
dst
=
NULL
;
*
maxread
=
left
;
*
maxread
=
left
;
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
...
libavformat/movenchint.c
View file @
8e32b1f0
...
@@ -458,7 +458,6 @@ done:
...
@@ -458,7 +458,6 @@ done:
void
ff_mov_close_hinting
(
MOVTrack
*
track
)
void
ff_mov_close_hinting
(
MOVTrack
*
track
)
{
{
AVFormatContext
*
rtp_ctx
=
track
->
rtp_ctx
;
AVFormatContext
*
rtp_ctx
=
track
->
rtp_ctx
;
uint8_t
*
ptr
;
av_freep
(
&
track
->
enc
);
av_freep
(
&
track
->
enc
);
sample_queue_free
(
&
track
->
sample_queue
);
sample_queue_free
(
&
track
->
sample_queue
);
...
@@ -466,8 +465,7 @@ void ff_mov_close_hinting(MOVTrack *track)
...
@@ -466,8 +465,7 @@ void ff_mov_close_hinting(MOVTrack *track)
return
;
return
;
if
(
rtp_ctx
->
pb
)
{
if
(
rtp_ctx
->
pb
)
{
av_write_trailer
(
rtp_ctx
);
av_write_trailer
(
rtp_ctx
);
avio_close_dyn_buf
(
rtp_ctx
->
pb
,
&
ptr
);
ffio_free_dyn_buf
(
&
rtp_ctx
->
pb
);
av_free
(
ptr
);
}
}
avformat_free_context
(
rtp_ctx
);
avformat_free_context
(
rtp_ctx
);
}
}
libavformat/mpegtsenc.c
View file @
8e32b1f0
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include "libavcodec/internal.h"
#include "libavcodec/internal.h"
#include "avformat.h"
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
#include "internal.h"
#include "mpegts.h"
#include "mpegts.h"
...
@@ -1110,9 +1111,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
...
@@ -1110,9 +1111,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
ret
=
av_write_frame
(
ts_st
->
amux
,
&
pkt2
);
ret
=
av_write_frame
(
ts_st
->
amux
,
&
pkt2
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
avio_close_dyn_buf
(
ts_st
->
amux
->
pb
,
&
data
);
ffio_free_dyn_buf
(
&
ts_st
->
amux
->
pb
);
ts_st
->
amux
->
pb
=
NULL
;
av_free
(
data
);
return
ret
;
return
ret
;
}
}
size
=
avio_close_dyn_buf
(
ts_st
->
amux
->
pb
,
&
data
);
size
=
avio_close_dyn_buf
(
ts_st
->
amux
->
pb
,
&
data
);
...
...
libavformat/nutenc.c
View file @
8e32b1f0
...
@@ -616,11 +616,8 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc)
...
@@ -616,11 +616,8 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc)
return
ret
;
return
ret
;
if
(
ret
>
0
)
if
(
ret
>
0
)
put_packet
(
nut
,
bc
,
dyn_bc
,
1
,
INFO_STARTCODE
);
put_packet
(
nut
,
bc
,
dyn_bc
,
1
,
INFO_STARTCODE
);
else
{
else
uint8_t
*
buf
;
ffio_free_dyn_buf
(
&
dyn_bc
);
avio_close_dyn_buf
(
dyn_bc
,
&
buf
);
av_free
(
buf
);
}
}
}
for
(
i
=
0
;
i
<
nut
->
avf
->
nb_chapters
;
i
++
)
{
for
(
i
=
0
;
i
<
nut
->
avf
->
nb_chapters
;
i
++
)
{
...
@@ -629,9 +626,7 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc)
...
@@ -629,9 +626,7 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc)
return
ret
;
return
ret
;
ret
=
write_chapter
(
nut
,
dyn_bc
,
i
);
ret
=
write_chapter
(
nut
,
dyn_bc
,
i
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
uint8_t
*
buf
;
ffio_free_dyn_buf
(
&
dyn_bc
);
avio_close_dyn_buf
(
dyn_bc
,
&
buf
);
av_freep
(
&
buf
);
return
ret
;
return
ret
;
}
}
put_packet
(
nut
,
bc
,
dyn_bc
,
1
,
INFO_STARTCODE
);
put_packet
(
nut
,
bc
,
dyn_bc
,
1
,
INFO_STARTCODE
);
...
...
libavformat/rtpenc_chain.c
View file @
8e32b1f0
...
@@ -89,9 +89,7 @@ int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s,
...
@@ -89,9 +89,7 @@ int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s,
if
(
handle
&&
rtpctx
->
pb
)
{
if
(
handle
&&
rtpctx
->
pb
)
{
avio_close
(
rtpctx
->
pb
);
avio_close
(
rtpctx
->
pb
);
}
else
if
(
rtpctx
->
pb
)
{
}
else
if
(
rtpctx
->
pb
)
{
uint8_t
*
ptr
;
ffio_free_dyn_buf
(
&
rtpctx
->
pb
);
avio_close_dyn_buf
(
rtpctx
->
pb
,
&
ptr
);
av_free
(
ptr
);
}
}
avformat_free_context
(
rtpctx
);
avformat_free_context
(
rtpctx
);
return
ret
;
return
ret
;
...
...
libavformat/rtpenc_mpegts.c
View file @
8e32b1f0
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include "libavutil/mathematics.h"
#include "libavutil/mathematics.h"
#include "avformat.h"
#include "avformat.h"
#include "avio_internal.h"
struct
MuxChain
{
struct
MuxChain
{
AVFormatContext
*
mpegts_ctx
;
AVFormatContext
*
mpegts_ctx
;
...
@@ -33,11 +34,7 @@ static int rtp_mpegts_write_close(AVFormatContext *s)
...
@@ -33,11 +34,7 @@ static int rtp_mpegts_write_close(AVFormatContext *s)
if
(
chain
->
mpegts_ctx
)
{
if
(
chain
->
mpegts_ctx
)
{
av_write_trailer
(
chain
->
mpegts_ctx
);
av_write_trailer
(
chain
->
mpegts_ctx
);
if
(
chain
->
mpegts_ctx
->
pb
)
{
ffio_free_dyn_buf
(
&
chain
->
mpegts_ctx
->
pb
);
uint8_t
*
buf
;
avio_close_dyn_buf
(
chain
->
mpegts_ctx
->
pb
,
&
buf
);
av_free
(
buf
);
}
avformat_free_context
(
chain
->
mpegts_ctx
);
avformat_free_context
(
chain
->
mpegts_ctx
);
}
}
if
(
chain
->
rtp_ctx
)
{
if
(
chain
->
rtp_ctx
)
{
...
@@ -101,11 +98,7 @@ static int rtp_mpegts_write_header(AVFormatContext *s)
...
@@ -101,11 +98,7 @@ static int rtp_mpegts_write_header(AVFormatContext *s)
fail:
fail:
if
(
mpegts_ctx
)
{
if
(
mpegts_ctx
)
{
if
(
mpegts_ctx
->
pb
)
{
ffio_free_dyn_buf
(
&
chain
->
mpegts_ctx
->
pb
);
uint8_t
*
buf
;
avio_close_dyn_buf
(
mpegts_ctx
->
pb
,
&
buf
);
av_free
(
buf
);
}
avformat_free_context
(
mpegts_ctx
);
avformat_free_context
(
mpegts_ctx
);
}
}
if
(
rtp_ctx
)
if
(
rtp_ctx
)
...
...
libavformat/rtsp.c
View file @
8e32b1f0
...
@@ -703,11 +703,9 @@ void ff_rtsp_undo_setup(AVFormatContext *s, int send_packets)
...
@@ -703,11 +703,9 @@ void ff_rtsp_undo_setup(AVFormatContext *s, int send_packets)
AVFormatContext
*
rtpctx
=
rtsp_st
->
transport_priv
;
AVFormatContext
*
rtpctx
=
rtsp_st
->
transport_priv
;
av_write_trailer
(
rtpctx
);
av_write_trailer
(
rtpctx
);
if
(
rt
->
lower_transport
==
RTSP_LOWER_TRANSPORT_TCP
)
{
if
(
rt
->
lower_transport
==
RTSP_LOWER_TRANSPORT_TCP
)
{
uint8_t
*
ptr
;
if
(
CONFIG_RTSP_MUXER
&&
rtpctx
->
pb
&&
send_packets
)
if
(
CONFIG_RTSP_MUXER
&&
rtpctx
->
pb
&&
send_packets
)
ff_rtsp_tcp_write_packet
(
s
,
rtsp_st
);
ff_rtsp_tcp_write_packet
(
s
,
rtsp_st
);
avio_close_dyn_buf
(
rtpctx
->
pb
,
&
ptr
);
ffio_free_dyn_buf
(
&
rtpctx
->
pb
);
av_free
(
ptr
);
}
else
{
}
else
{
avio_close
(
rtpctx
->
pb
);
avio_close
(
rtpctx
->
pb
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment