diff options
author | Jun Xie <jun.xie@samsung.com> | 2017-10-22 18:26:12 +0800 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-11-20 10:31:36 +0200 |
commit | bde900dc6e75b30c771d0fa1ed1a1096e7b57f91 (patch) | |
tree | e1e3c0261e0d2591046cc87e769088791605202a | |
parent | d485733bc5e81821963fad2613fbb92b52d6c0ed (diff) | |
download | gstreamer-plugins-good-bde900dc6e75b30c771d0fa1ed1a1096e7b57f91.tar.gz |
qtdemux: reset reused QtDemuxStream while parsing a new 'trak'
if QtDemuxStream is reused, then we need to reset it.
https://bugzilla.gnome.org/show_bug.cgi?id=788759
-rw-r--r-- | gst/isomp4/qtdemux.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 9dc3af56e..ded00c409 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -2532,7 +2532,7 @@ gst_qtdemux_stream_clear (GstQTDemux * qtdemux, QtDemuxStream * stream) } static void -gst_qtdemux_stream_free (GstQTDemux * qtdemux, QtDemuxStream * stream) +gst_qtdemux_stream_reset (GstQTDemux * qtdemux, QtDemuxStream * stream) { gint i; gst_qtdemux_stream_clear (qtdemux, stream); @@ -2543,12 +2543,21 @@ gst_qtdemux_stream_free (GstQTDemux * qtdemux, QtDemuxStream * stream) entry->caps = NULL; } } + g_free (stream->stsd_entries); + stream->stsd_entries = NULL; + stream->stsd_entries_length = 0; +} + + +static void +gst_qtdemux_stream_free (GstQTDemux * qtdemux, QtDemuxStream * stream) +{ + gst_qtdemux_stream_reset(qtdemux, stream); gst_tag_list_unref (stream->stream_tags); if (stream->pad) { gst_element_remove_pad (GST_ELEMENT_CAST (qtdemux), stream->pad); gst_flow_combiner_remove_pad (qtdemux->flowcombiner, stream->pad); } - g_free (stream->stsd_entries); g_free (stream); } @@ -9613,11 +9622,8 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak) goto skip_track; } - stream->stream_tags = gst_tag_list_make_writable (stream->stream_tags); - - /* flush samples data from this track from previous moov */ - gst_qtdemux_stream_flush_segments_data (qtdemux, stream); - gst_qtdemux_stream_flush_samples_data (qtdemux, stream); + /* reset reused stream */ + gst_qtdemux_stream_reset(qtdemux, stream); } /* need defaults for fragments */ qtdemux_parse_trex (qtdemux, stream, &dummy, &dummy, &dummy); |