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
63ccf45395 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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/522>
This commit is contained in:
Thibault Saunier 2020-06-07 12:05:07 -04:00 committed by GStreamer Merge Bot
parent 33557f8db1
commit 9d195da36c

View file

@ -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);