mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-05-28 21:16:56 +08:00
libavformat: Add a function for freeing an AVFormatContext
This function is useful for freeing data structures allocated by muxers, which currently have to be freed manually by the caller. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
This commit is contained in:

committed by
Ronald S. Bultje

parent
1338dc0823
commit
f124b087ee
@ -2556,12 +2556,17 @@ int av_read_pause(AVFormatContext *s)
|
||||
|
||||
void av_close_input_stream(AVFormatContext *s)
|
||||
{
|
||||
int i;
|
||||
AVStream *st;
|
||||
|
||||
flush_packet_queue(s);
|
||||
if (s->iformat->read_close)
|
||||
s->iformat->read_close(s);
|
||||
avformat_free_context(s);
|
||||
}
|
||||
|
||||
void avformat_free_context(AVFormatContext *s)
|
||||
{
|
||||
int i;
|
||||
AVStream *st;
|
||||
|
||||
for(i=0;i<s->nb_streams;i++) {
|
||||
/* free all data in a stream component */
|
||||
st = s->streams[i];
|
||||
|
Reference in New Issue
Block a user