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.
This commit is contained in:
Sebastian Dröge 2016-05-10 15:01:42 +03:00
parent c9da8b0e7f
commit 14f71d2e27

View file

@ -1137,6 +1137,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) {