decodebin3: fix stream leaks
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 14 Jul 2016 08:34:30 +0000 (10:34 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 18 Jul 2016 12:57:44 +0000 (13:57 +0100)
MultiQueueSlot owns a ref on the active stream so it should release it
when being freed.

DecodebinInputStream owns ref on the active and pending stream so they
should be dropped when being freed.

https://bugzilla.gnome.org/show_bug.cgi?id=768811

gst/playback/gstdecodebin3-parse.c
gst/playback/gstdecodebin3.c

index 0f1a17d..a54cf82 100644 (file)
@@ -360,6 +360,11 @@ remove_input_stream (GstDecodebin3 * dbin, DecodebinInputStream * stream)
     GST_DEBUG_OBJECT (dbin, "slot %p cleared", slot);
   }
 
+  if (stream->active_stream)
+    gst_object_unref (stream->active_stream);
+  if (stream->pending_stream)
+    gst_object_unref (stream->pending_stream);
+
   dbin->input_streams = g_list_remove (dbin->input_streams, stream);
 
   g_free (stream);
index 67afc4a..c216590 100644 (file)
@@ -2312,6 +2312,7 @@ free_multiqueue_slot (GstDecodebin3 * dbin, MultiQueueSlot * slot)
   gst_element_release_request_pad (dbin->multiqueue, slot->sink_pad);
   gst_object_replace ((GstObject **) & slot->sink_pad, NULL);
   gst_object_replace ((GstObject **) & slot->src_pad, NULL);
+  gst_object_replace ((GstObject **) & slot->active_stream, NULL);
   g_free (slot);
 }