mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 11:10:37 +00:00
plugins/elements/gstinputselector.c: Ensure we emit notify::active-pad when auto-selecting a pad due to it having activit...
Original commit message from CVS: * plugins/elements/gstinputselector.c: Ensure we emit notify::active-pad when auto-selecting a pad due to it having activity and us not having an existing active pad. Fixes #563147
This commit is contained in:
parent
acafa09a74
commit
981d08088c
1 changed files with 11 additions and 0 deletions
|
@ -455,6 +455,7 @@ gst_selector_pad_bufferalloc (GstPad * pad, guint64 offset,
|
|||
GstInputSelector *sel;
|
||||
GstFlowReturn result;
|
||||
GstPad *active_sinkpad;
|
||||
GstPad *prev_active_sinkpad;
|
||||
GstSelectorPad *selpad;
|
||||
|
||||
sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
|
||||
|
@ -463,6 +464,7 @@ gst_selector_pad_bufferalloc (GstPad * pad, guint64 offset,
|
|||
GST_DEBUG_OBJECT (pad, "received alloc");
|
||||
|
||||
GST_INPUT_SELECTOR_LOCK (sel);
|
||||
prev_active_sinkpad = sel->active_sinkpad;
|
||||
active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad);
|
||||
|
||||
if (pad != active_sinkpad)
|
||||
|
@ -470,6 +472,9 @@ gst_selector_pad_bufferalloc (GstPad * pad, guint64 offset,
|
|||
|
||||
GST_INPUT_SELECTOR_UNLOCK (sel);
|
||||
|
||||
if (prev_active_sinkpad != active_sinkpad && pad == active_sinkpad)
|
||||
g_object_notify (G_OBJECT (sel), "active-pad");
|
||||
|
||||
result = gst_pad_alloc_buffer (sel->srcpad, offset, size, caps, buf);
|
||||
|
||||
done:
|
||||
|
@ -518,6 +523,7 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
|
|||
GstInputSelector *sel;
|
||||
GstFlowReturn res;
|
||||
GstPad *active_sinkpad;
|
||||
GstPad *prev_active_sinkpad;
|
||||
GstSelectorPad *selpad;
|
||||
GstClockTime end_time, duration;
|
||||
GstSegment *seg;
|
||||
|
@ -534,6 +540,7 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
|
|||
|
||||
GST_DEBUG_OBJECT (pad, "getting active pad");
|
||||
|
||||
prev_active_sinkpad = sel->active_sinkpad;
|
||||
active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad);
|
||||
|
||||
/* update the segment on the srcpad */
|
||||
|
@ -586,6 +593,9 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
|
|||
}
|
||||
GST_INPUT_SELECTOR_UNLOCK (sel);
|
||||
|
||||
if (prev_active_sinkpad != active_sinkpad && pad == active_sinkpad)
|
||||
g_object_notify (G_OBJECT (sel), "active-pad");
|
||||
|
||||
if (close_event)
|
||||
gst_pad_push_event (sel->srcpad, close_event);
|
||||
|
||||
|
@ -912,6 +922,7 @@ gst_input_selector_set_active_pad (GstInputSelector * self,
|
|||
/* schedule a last_stop update if one isn't already scheduled, and a
|
||||
segment has been pushed before. */
|
||||
memcpy (&self->segment, &old->segment, sizeof (self->segment));
|
||||
|
||||
GST_DEBUG_OBJECT (self, "setting stop_time to %" G_GINT64_FORMAT,
|
||||
stop_time);
|
||||
gst_segment_set_stop (&self->segment, stop_time);
|
||||
|
|
Loading…
Reference in a new issue