decodebin3: Clear input collection when linked again
authorEdward Hervey <edward@centricular.com>
Mon, 14 Nov 2022 08:54:24 +0000 (09:54 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 16 Nov 2022 14:01:47 +0000 (14:01 +0000)
The previous collection no longer applies to this input

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c

index 3968929..c5543b8 100644 (file)
@@ -891,6 +891,17 @@ gst_decodebin3_input_pad_link (GstPad * pad, GstObject * parent, GstPad * peer)
       res = GST_PAD_LINK_REFUSED;
     }
   }
+
+  /* Clear stream-collection corresponding to current INPUT.  We do not
+   * recalculate the global one yet, it will be done when at least one
+   * collection is received/computed for this input.
+   */
+  if (input->collection) {
+    GST_DEBUG_OBJECT (pad, "Clearing input collection");
+    gst_object_unref (input->collection);
+    input->collection = NULL;
+  }
+
   INPUT_UNLOCK (dbin);
 
   return res;