aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-11-10 18:42:08 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2015-11-10 18:42:08 +0100
commit3df9ec5ce7bc57ee303e715b949f65727a52c916 (patch)
tree6a4acc2812523eef0ed64e4fde7e41ac26eb3ce6 /libavformat
parentd3d4bc4784d911236b232e56e4ae476c484381c8 (diff)
parentaeda1121c91395d1f0d434bc7f227423aa2ff97d (diff)
downloadffmpeg-3df9ec5ce7bc57ee303e715b949f65727a52c916.tar.gz
Merge commit 'aeda1121c91395d1f0d434bc7f227423aa2ff97d'
* commit 'aeda1121c91395d1f0d434bc7f227423aa2ff97d': lavf: factor out freeing an AVStream Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index bab8118296..e55b29479b 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3659,13 +3659,13 @@ void ff_free_stream(AVFormatContext *s, AVStream *st) {
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) {
+ if (st->parser)
av_parser_close(st->parser);
- }
+
if (st->attached_pic.data)
av_packet_unref(&st->attached_pic);
+
av_dict_free(&st->metadata);
av_freep(&st->probe_data.buf);
av_freep(&st->index_entries);
@@ -3694,9 +3694,10 @@ void avformat_free_context(AVFormatContext *s)
if (s->oformat && s->oformat->priv_class && s->priv_data)
av_opt_free(s->priv_data);
- for (i = s->nb_streams - 1; i >= 0; i--) {
+ for (i = s->nb_streams - 1; i >= 0; i--)
ff_free_stream(s, s->streams[i]);
- }
+
+
for (i = s->nb_programs - 1; i >= 0; i--) {
av_dict_free(&s->programs[i]->metadata);
av_freep(&s->programs[i]->stream_index);