mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
input-selector: Activate and notify pad before processing events.
Events should trigger pad selection if we don't already have an explicitly selected pad, so that events prior to first buffer don't get lost.
This commit is contained in:
parent
09424e4b3a
commit
55637934d1
1 changed files with 13 additions and 8 deletions
|
@ -342,17 +342,23 @@ gst_selector_pad_event (GstPad * pad, GstEvent * event)
|
|||
gboolean forward = TRUE;
|
||||
GstInputSelector *sel;
|
||||
GstSelectorPad *selpad;
|
||||
GstPad *active_sinkpad;
|
||||
gboolean notify;
|
||||
|
||||
sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
|
||||
selpad = GST_SELECTOR_PAD_CAST (pad);
|
||||
|
||||
/* only forward if we are dealing with the active sinkpad */
|
||||
forward = gst_input_selector_is_active_sinkpad (sel, pad);
|
||||
GST_INPUT_SELECTOR_LOCK (sel);
|
||||
active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad, ¬ify);
|
||||
|
||||
/* forward all events in select_all mode by default */
|
||||
if (sel->select_all) {
|
||||
forward = TRUE;
|
||||
}
|
||||
/* only forward if we are dealing with the active sinkpad or if select_all
|
||||
* is enabled */
|
||||
if (pad != active_sinkpad && !sel->select_all)
|
||||
forward = FALSE;
|
||||
GST_INPUT_SELECTOR_UNLOCK (sel);
|
||||
|
||||
if (notify)
|
||||
g_object_notify (G_OBJECT (sel), "active-pad");
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_FLUSH_START:
|
||||
|
@ -1037,8 +1043,7 @@ gst_input_selector_event (GstPad * pad, GstEvent * event)
|
|||
res = gst_pad_push_event (otherpad, event);
|
||||
|
||||
gst_object_unref (otherpad);
|
||||
}
|
||||
else
|
||||
} else
|
||||
gst_event_unref (event);
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue