From 7eb494257c483121ff6dda1d2353925709086e8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 10 May 2016 15:01:42 +0300 Subject: [PATCH] pad: Fix pad state when deactivating from one mode and then trying to activate another and failing When activating a pad in PULL mode, it might already be in PUSH mode. We now first try to deactivate it from PUSH mode and then try to activate it in PULL mode. If the activation fails, we would set the pad to flushing and set it back to its old mode. However the old mode is wrong, the pad is not in PUSH mode anymore but in NONE mode. This fixes e.g. typefind in decodebin reactivating PUSH/PULL mode if upstream actually fails to go into PULL mode after first PUSHING data to typefind. --- gst/gstpad.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gst/gstpad.c b/gst/gstpad.c index 9bccd8d0f3..d357ec14ea 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -1135,6 +1135,7 @@ activate_mode_internal (GstPad * pad, GstObject * parent, GstPadMode mode, if (G_UNLIKELY (!activate_mode_internal (pad, parent, old, FALSE))) goto deactivate_failed; + old = GST_PAD_MODE_NONE; } switch (mode) {