tsdemux: Clear bufferlist/iterator when removing streams
authorEdward Hervey <edward.hervey@collabora.co.uk>
Mon, 2 Apr 2012 13:26:28 +0000 (15:26 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Mon, 2 Apr 2012 13:26:28 +0000 (15:26 +0200)
gst/mpegtsdemux/tsdemux.c

index 54318f03b07a17bb957f1f3a178eeb1556557786..8b97b8e43295d34356318594ef0f99f9cc1c91eb 100644 (file)
@@ -1032,6 +1032,16 @@ gst_ts_demux_stream_flush (TSDemuxStream * stream)
   memset (stream->pendingbuffers, 0, TS_MAX_PENDING_BUFFERS);
   stream->nbpending = 0;
 
+  if (stream->current) {
+    gst_buffer_list_unref (stream->current);
+    stream->current = NULL;
+  }
+
+  if (stream->currentit) {
+    gst_buffer_list_iterator_free (stream->currentit);
+    stream->currentit = NULL;
+  }
+
   if (stream->currentlist) {
     g_list_foreach (stream->currentlist, (GFunc) gst_buffer_unref, NULL);
     g_list_free (stream->currentlist);