From 9d195da36ce67d23e712515a8adaf91e5a3ee1d1 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Sun, 7 Jun 2020 12:05:07 -0400 Subject: [PATCH] inputselector: Push event on selected pad only when one is selected Calling `gst_input_selector_get_active_sinkpad` triggers sinkpad selection but won't notify about it, leading to breaking code that relying on it. This new code added as part of 63ccf45395ce734a2044a58193939a3eda50eb0c was thought to be triggered only when a pad was already selected and not change the behavior otherwise so this commit makes sure it is actually the case. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/766 Part-of: --- plugins/elements/gstinputselector.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c index 58302bf52d..da2fe39490 100644 --- a/plugins/elements/gstinputselector.c +++ b/plugins/elements/gstinputselector.c @@ -1547,9 +1547,8 @@ gst_input_selector_event (GstPad * pad, GstObject * parent, GstEvent * event) iter = gst_element_iterate_sink_pads (GST_ELEMENT_CAST (sel)); GST_INPUT_SELECTOR_LOCK (sel); - eventpad = gst_input_selector_get_active_sinkpad (sel); - if (eventpad) { - gst_object_ref (eventpad); + if (sel->active_sinkpad) { + eventpad = gst_object_ref (sel->active_sinkpad); GST_INPUT_SELECTOR_UNLOCK (sel); gst_event_ref (event);