diff options
author | Jan Schmidt <jan@centricular.com> | 2015-10-29 10:53:29 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-11-07 21:27:35 +0300 |
commit | c9881d191e999beab74bebfb8ced9df141ec9133 (patch) | |
tree | 8b3bf3110cff715da840ddc1acf4d8d86c554f6c | |
parent | ce147f81dd6d4aecb61b2879b28d6591baccdd2f (diff) |
ghostpad: Allow deactivation with no peer.
Allow deactivation in pull-mode, since that implies we
had a peer, activated in pull mode, then the peer disa-peer-ed ;)
-rw-r--r-- | gst/gstghostpad.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gst/gstghostpad.c b/gst/gstghostpad.c index 22644fc196..96703ed3eb 100644 --- a/gst/gstghostpad.c +++ b/gst/gstghostpad.c @@ -318,10 +318,13 @@ gst_ghost_pad_internal_activate_pull_default (GstPad * pad, GstObject * parent, GST_LOG_OBJECT (pad, "activating peer"); ret = gst_pad_activate_mode (other, GST_PAD_MODE_PULL, active); gst_object_unref (other); - } else { + } else if (active) { /* this is failure, we can't activate pull if there is no peer */ GST_LOG_OBJECT (pad, "not src and no peer, failing"); ret = FALSE; + } else { + GST_LOG_OBJECT (pad, "deactivating pull, with no peer - allowing"); + ret = TRUE; } return ret; @@ -406,10 +409,13 @@ gst_ghost_pad_activate_pull_default (GstPad * pad, GstObject * parent, GST_LOG_OBJECT (pad, "activating peer"); ret = gst_pad_activate_mode (other, GST_PAD_MODE_PULL, active); gst_object_unref (other); - } else { - /* no peer, we fail */ - GST_LOG_OBJECT (pad, "pad not src and no peer, failing"); + } else if (active) { + /* this is failure, we can't activate pull if there is no peer */ + GST_LOG_OBJECT (pad, "not src and no peer, failing"); ret = FALSE; + } else { + GST_LOG_OBJECT (pad, "deactivating pull, with no peer - allowing"); + ret = TRUE; } return ret; |