summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-02-19 12:10:32 +0100
committerAnton Khirnov <anton@khirnov.net>2014-03-24 06:07:51 +0100
commit25b32586566f285d797737863c97a1c5c9c84e2b (patch)
tree75da9bdaea35c7d4cd050414949cb23bbf133a16 /libavformat/utils.c
parent0e2c3ee9a335d8a0a5edf0509e222e804d7b2619 (diff)
lavf: add an AVStream field for exporting stream-global side data
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c8
1 files changed, 7 insertions, 1 deletions
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);
}