diff options
author | Nicolas Huet <nicolas.huet@parrot.com> | 2015-11-10 16:32:37 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-11-16 09:17:40 +0200 |
commit | 563e3c0458ac49a335f940e16bbd1cf8e1b03ef5 (patch) | |
tree | 2eb3d3d4efbe7edbfc8a6ecc8d0726333c395e59 /gst | |
parent | 7255e484e0da69351bc48de208df53c72358e886 (diff) | |
download | gstreamer-plugins-bad-563e3c0458ac49a335f940e16bbd1cf8e1b03ef5.tar.gz |
tsdemux: fix pending buffers leak when flushing
https://bugzilla.gnome.org/show_bug.cgi?id=757895
Diffstat (limited to 'gst')
-rw-r--r-- | gst/mpegtsdemux/tsdemux.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index 566b7c558..5231c05d2 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -1552,6 +1552,20 @@ gst_ts_demux_stream_flush (TSDemuxStream * stream, GstTSDemux * tsdemux, stream->gap_ref_buffers = 0; stream->gap_ref_pts = GST_CLOCK_TIME_NONE; stream->continuity_counter = CONTINUITY_UNSET; + + if (G_UNLIKELY (stream->pending)) { + GList *tmp; + + GST_DEBUG ("clearing pending %p", stream); + for (tmp = stream->pending; tmp; tmp = tmp->next) { + PendingBuffer *pend = (PendingBuffer *) tmp->data; + gst_buffer_unref (pend->buffer); + g_slice_free (PendingBuffer, pend); + } + g_list_free (stream->pending); + stream->pending = NULL; + } + if (hard) { stream->first_pts = GST_CLOCK_TIME_NONE; stream->need_newsegment = TRUE; |