From 04242fbe5ce805df7efd8ce6bf1a5db4280d0224 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Fri, 6 Nov 2015 19:31:47 +0100 Subject: decodebin: Properly deactivate ghostpads Just setting the ghostpad as flushing wasn't enough. It needs to be consistent on the internal proxypad also, otherwise you end up in situations where: * a pending buffer on the target pad triggers the sticky event propagation * the default implementation sees that the proxypad is not flushing, so it tries to push it to the other pad (the actual ghostpad) * the ghostpad is flushing, so returns FALSE * the push_event function sees that pushing the event failed... * ... and pending buffer push returns GST_FLOW_ERROR, instead of GST_FLOW_FLUSHING By using gst_pad_set_active(FALSE), we ensure that both the ghostpad and the proxypad are flushing/deactivated. The situation above will no longer occur, and a GST_FLOW_FLUSHING will be returned. --- gst/playback/gstdecodebin2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 3afad0d1d..5f27c1d37 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -5122,7 +5122,7 @@ unblock_pads (GstDecodeBin * dbin) } dpad->blocked = FALSE; /* make flushing, prevent NOT_LINKED */ - GST_PAD_SET_FLUSHING (GST_PAD_CAST (dpad)); + gst_pad_set_active (GST_PAD_CAST (dpad), FALSE); gst_object_unref (dpad); gst_object_unref (opad); GST_DEBUG_OBJECT (dpad, "unblocked"); -- cgit v1.2.1