slitmuxsrc: Properly stop the loop if not part reader is present
authorEdward Hervey <edward@centricular.com>
Tue, 5 May 2020 13:19:49 +0000 (15:19 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Tue, 5 May 2020 13:32:58 +0000 (15:32 +0200)
Previously this would end up in a refcounting loop of hell.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/578>

gst/multifile/gstsplitmuxsrc.c

index f8c27fb..25c5d77 100644 (file)
@@ -751,7 +751,11 @@ gst_splitmux_pad_loop (GstPad * pad)
 
   GST_OBJECT_LOCK (splitpad);
   if (splitpad->part_pad == NULL) {
+    GST_DEBUG_OBJECT (splitmux,
+        "Pausing task because part reader is not present");
     GST_OBJECT_UNLOCK (splitpad);
+    gst_pad_pause_task (pad);
+    gst_object_unref (splitmux);
     return;
   }
   part_pad = gst_object_ref (splitpad->part_pad);