From 45447337ad7189ade81226064b36eff172673c79 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Thu, 14 Jan 2010 18:26:03 +0100 Subject: [PATCH] decodebin2: mind blocked pads when shutting down Fix regression in shutdown deadlock handling now that the target of a ghostpad is blocked instead of ghostpad itself. See also #574293. --- gst/playback/gstdecodebin2.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 95cc645fe1..470ddc4b6f 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -3164,14 +3164,20 @@ gst_decode_pad_set_blocked (GstDecodePad * dpad, gboolean blocked) if (!opad) goto out; - gst_pad_set_blocked_async_full (opad, blocked, - (GstPadBlockCallback) source_pad_blocked_cb, gst_object_ref (dpad), - (GDestroyNotify) gst_object_unref); + /* do not block if shutting down. + * we do not consider/expect it blocked further below, but use other trick */ + if (!blocked || !dbin->shutdown) + gst_pad_set_blocked_async_full (opad, blocked, + (GstPadBlockCallback) source_pad_blocked_cb, gst_object_ref (dpad), + (GDestroyNotify) gst_object_unref); if (blocked) { if (dbin->shutdown) { /* deactivate to force flushing state to prevent NOT_LINKED errors */ gst_pad_set_active (GST_PAD_CAST (dpad), FALSE); + /* note that deactivating the target pad would have no effect here, + * since elements are typically connected first (and pads exposed), + * and only then brought to PAUSED state (so pads activated) */ } else { gst_object_ref (dpad); dbin->blocked_pads = g_list_prepend (dbin->blocked_pads, dpad);