uridecodebin3: Avoid repeatedly calling the blocking probe
authorEdward Hervey <edward@centricular.com>
Thu, 29 Dec 2022 15:01:07 +0000 (16:01 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Fri, 30 Dec 2022 07:46:13 +0000 (08:46 +0100)
When skipping an event, we want to unref it and say we handled it. This avoids
being repeatedly called for the same (sticky) events.

The events will be properly propagated once the pad is linked.

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

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

index 56553c5..02ce055 100644 (file)
@@ -1232,7 +1232,10 @@ uri_src_block_probe (GstPad * pad, GstPadProbeInfo * info,
       }
     }
     GST_LOG_OBJECT (pad, "Skiping %" GST_PTR_FORMAT, event);
-    return GST_PAD_PROBE_DROP;
+    /* We don't want to be repeatedly called for the same event when unlinked,
+     * so we mark the event as handled */
+    gst_mini_object_unref (GST_PAD_PROBE_INFO_DATA (info));
+    return GST_PAD_PROBE_HANDLED;
   }
 
   PLAY_ITEMS_LOCK (handler->uridecodebin);