From 25b32586566f285d797737863c97a1c5c9c84e2b Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 19 Feb 2014 12:10:32 +0100 Subject: lavf: add an AVStream field for exporting stream-global side data --- libavformat/utils.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libavformat/utils.c') diff --git a/libavformat/utils.c b/libavformat/utils.c index 3f400e33a7..164cdd7a6a 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2595,7 +2595,7 @@ int av_read_pause(AVFormatContext *s) void avformat_free_context(AVFormatContext *s) { - int i; + int i, j; AVStream *st; av_opt_free(s); @@ -2605,6 +2605,12 @@ void avformat_free_context(AVFormatContext *s) for (i = 0; i < s->nb_streams; i++) { /* free all data in a stream component */ st = s->streams[i]; + + for (j = 0; j < st->nb_side_data; j++) + av_freep(&st->side_data[j].data); + av_freep(&st->side_data); + st->nb_side_data = 0; + if (st->parser) { av_parser_close(st->parser); } -- cgit v1.2.3