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
b22dbb29
Commit
b22dbb29
authored
Feb 04, 2011
by
Martin Storsjö
Committed by
Ronald S. Bultje
Feb 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use avformat_free_context for cleaning up muxers
Signed-off-by:
Ronald S. Bultje
<
rsbultje@gmail.com
>
parent
ff197489
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
51 deletions
+7
-51
ffmpeg.c
ffmpeg.c
+1
-15
movenchint.c
libavformat/movenchint.c
+3
-17
rtpenc_chain.c
libavformat/rtpenc_chain.c
+1
-5
rtsp.c
libavformat/rtsp.c
+1
-7
sapenc.c
libavformat/sapenc.c
+1
-7
No files found.
ffmpeg.c
View file @
b22dbb29
...
...
@@ -505,25 +505,11 @@ static int ffmpeg_exit(int ret)
/* close files */
for
(
i
=
0
;
i
<
nb_output_files
;
i
++
)
{
/* maybe av_close_output_file ??? */
AVFormatContext
*
s
=
output_files
[
i
];
int
j
;
if
(
!
(
s
->
oformat
->
flags
&
AVFMT_NOFILE
)
&&
s
->
pb
)
url_fclose
(
s
->
pb
);
for
(
j
=
0
;
j
<
s
->
nb_streams
;
j
++
)
{
av_metadata_free
(
&
s
->
streams
[
j
]
->
metadata
);
av_free
(
s
->
streams
[
j
]
->
codec
);
av_free
(
s
->
streams
[
j
]
->
info
);
av_free
(
s
->
streams
[
j
]);
}
for
(
j
=
0
;
j
<
s
->
nb_programs
;
j
++
)
{
av_metadata_free
(
&
s
->
programs
[
j
]
->
metadata
);
}
for
(
j
=
0
;
j
<
s
->
nb_chapters
;
j
++
)
{
av_metadata_free
(
&
s
->
chapters
[
j
]
->
metadata
);
}
av_metadata_free
(
&
s
->
metadata
);
av_free
(
s
);
avformat_free_context
(
s
);
av_free
(
output_streams_for_file
[
i
]);
}
for
(
i
=
0
;
i
<
nb_input_files
;
i
++
)
{
...
...
libavformat/movenchint.c
View file @
b22dbb29
...
...
@@ -81,17 +81,9 @@ fail:
url_close_dyn_buf
(
track
->
rtp_ctx
->
pb
,
&
buf
);
av_free
(
buf
);
}
if
(
track
->
rtp_ctx
&&
track
->
rtp_ctx
->
streams
[
0
])
{
av_metadata_free
(
&
track
->
rtp_ctx
->
streams
[
0
]
->
metadata
);
av_free
(
track
->
rtp_ctx
->
streams
[
0
]
->
codec
->
extradata
);
av_free
(
track
->
rtp_ctx
->
streams
[
0
]
->
codec
);
av_free
(
track
->
rtp_ctx
->
streams
[
0
]
->
info
);
av_free
(
track
->
rtp_ctx
->
streams
[
0
]);
}
if
(
track
->
rtp_ctx
)
{
av_metadata_free
(
&
track
->
rtp_ctx
->
metadata
);
av_free
(
track
->
rtp_ctx
->
priv_data
);
av_freep
(
&
track
->
rtp_ctx
);
avformat_free_context
(
track
->
rtp_ctx
);
track
->
rtp_ctx
=
NULL
;
}
av_freep
(
&
track
->
enc
);
/* Set a default timescale, to avoid crashes in dump_format */
...
...
@@ -488,12 +480,6 @@ void ff_mov_close_hinting(MOVTrack *track) {
url_close_dyn_buf
(
rtp_ctx
->
pb
,
&
ptr
);
av_free
(
ptr
);
}
av_metadata_free
(
&
rtp_ctx
->
streams
[
0
]
->
metadata
);
av_metadata_free
(
&
rtp_ctx
->
metadata
);
av_free
(
rtp_ctx
->
streams
[
0
]
->
codec
->
extradata
);
av_free
(
rtp_ctx
->
streams
[
0
]
->
codec
);
av_free
(
rtp_ctx
->
streams
[
0
]
->
info
);
av_free
(
rtp_ctx
->
streams
[
0
]);
av_freep
(
&
rtp_ctx
);
avformat_free_context
(
rtp_ctx
);
}
libavformat/rtpenc_chain.c
View file @
b22dbb29
...
...
@@ -66,11 +66,7 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
url_close_dyn_buf
(
rtpctx
->
pb
,
&
ptr
);
av_free
(
ptr
);
}
av_free
(
rtpctx
->
streams
[
0
]
->
codec
->
extradata
);
av_free
(
rtpctx
->
streams
[
0
]
->
codec
);
av_free
(
rtpctx
->
streams
[
0
]
->
info
);
av_free
(
rtpctx
->
streams
[
0
]);
av_free
(
rtpctx
);
avformat_free_context
(
rtpctx
);
return
NULL
;
}
...
...
libavformat/rtsp.c
View file @
b22dbb29
...
...
@@ -498,13 +498,7 @@ void ff_rtsp_undo_setup(AVFormatContext *s)
}
else
{
url_fclose
(
rtpctx
->
pb
);
}
av_metadata_free
(
&
rtpctx
->
streams
[
0
]
->
metadata
);
av_metadata_free
(
&
rtpctx
->
metadata
);
av_free
(
rtpctx
->
streams
[
0
]
->
codec
->
extradata
);
av_free
(
rtpctx
->
streams
[
0
]
->
codec
);
av_free
(
rtpctx
->
streams
[
0
]
->
info
);
av_free
(
rtpctx
->
streams
[
0
]);
av_free
(
rtpctx
);
avformat_free_context
(
rtpctx
);
}
else
if
(
rt
->
transport
==
RTSP_TRANSPORT_RDT
&&
CONFIG_RTPDEC
)
ff_rdt_parse_close
(
rtsp_st
->
transport_priv
);
else
if
(
CONFIG_RTPDEC
)
...
...
libavformat/sapenc.c
View file @
b22dbb29
...
...
@@ -46,13 +46,7 @@ static int sap_write_close(AVFormatContext *s)
continue
;
av_write_trailer
(
rtpctx
);
url_fclose
(
rtpctx
->
pb
);
av_metadata_free
(
&
rtpctx
->
streams
[
0
]
->
metadata
);
av_metadata_free
(
&
rtpctx
->
metadata
);
av_free
(
rtpctx
->
streams
[
0
]
->
codec
->
extradata
);
av_free
(
rtpctx
->
streams
[
0
]
->
codec
);
av_free
(
rtpctx
->
streams
[
0
]
->
info
);
av_free
(
rtpctx
->
streams
[
0
]);
av_free
(
rtpctx
);
avformat_free_context
(
rtpctx
);
s
->
streams
[
i
]
->
priv_data
=
NULL
;
}
...
...
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