mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
gst/selector/gstinputselector.c: Ensure we emit notify::active-pad when auto-selecting a pad due to it having activit...
Original commit message from CVS: * gst/selector/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
b52069748f
commit
7f57d31ff9
2 changed files with 18 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2008-12-04 Michael Smith <msmith@songbirdnest.com>
|
||||||
|
|
||||||
|
* gst/selector/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
|
||||||
|
|
||||||
2008-12-04 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
2008-12-04 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||||
|
|
||||||
* gst/mxf/mxfdemux.c:
|
* gst/mxf/mxfdemux.c:
|
||||||
|
|
|
@ -455,6 +455,7 @@ gst_selector_pad_bufferalloc (GstPad * pad, guint64 offset,
|
||||||
GstInputSelector *sel;
|
GstInputSelector *sel;
|
||||||
GstFlowReturn result;
|
GstFlowReturn result;
|
||||||
GstPad *active_sinkpad;
|
GstPad *active_sinkpad;
|
||||||
|
GstPad *prev_active_sinkpad;
|
||||||
GstSelectorPad *selpad;
|
GstSelectorPad *selpad;
|
||||||
|
|
||||||
sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
|
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_DEBUG_OBJECT (pad, "received alloc");
|
||||||
|
|
||||||
GST_INPUT_SELECTOR_LOCK (sel);
|
GST_INPUT_SELECTOR_LOCK (sel);
|
||||||
|
prev_active_sinkpad = sel->active_sinkpad;
|
||||||
active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad);
|
active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad);
|
||||||
|
|
||||||
if (pad != active_sinkpad)
|
if (pad != active_sinkpad)
|
||||||
|
@ -470,6 +472,9 @@ gst_selector_pad_bufferalloc (GstPad * pad, guint64 offset,
|
||||||
|
|
||||||
GST_INPUT_SELECTOR_UNLOCK (sel);
|
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);
|
result = gst_pad_alloc_buffer (sel->srcpad, offset, size, caps, buf);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
@ -518,6 +523,7 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
|
||||||
GstInputSelector *sel;
|
GstInputSelector *sel;
|
||||||
GstFlowReturn res;
|
GstFlowReturn res;
|
||||||
GstPad *active_sinkpad;
|
GstPad *active_sinkpad;
|
||||||
|
GstPad *prev_active_sinkpad;
|
||||||
GstSelectorPad *selpad;
|
GstSelectorPad *selpad;
|
||||||
GstClockTime end_time, duration;
|
GstClockTime end_time, duration;
|
||||||
GstSegment *seg;
|
GstSegment *seg;
|
||||||
|
@ -534,6 +540,7 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (pad, "getting active pad");
|
GST_DEBUG_OBJECT (pad, "getting active pad");
|
||||||
|
|
||||||
|
prev_active_sinkpad = sel->active_sinkpad;
|
||||||
active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad);
|
active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad);
|
||||||
|
|
||||||
/* update the segment on the srcpad */
|
/* update the segment on the srcpad */
|
||||||
|
@ -586,6 +593,9 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
|
||||||
}
|
}
|
||||||
GST_INPUT_SELECTOR_UNLOCK (sel);
|
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)
|
if (close_event)
|
||||||
gst_pad_push_event (sel->srcpad, 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
|
/* schedule a last_stop update if one isn't already scheduled, and a
|
||||||
segment has been pushed before. */
|
segment has been pushed before. */
|
||||||
memcpy (&self->segment, &old->segment, sizeof (self->segment));
|
memcpy (&self->segment, &old->segment, sizeof (self->segment));
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "setting stop_time to %" G_GINT64_FORMAT,
|
GST_DEBUG_OBJECT (self, "setting stop_time to %" G_GINT64_FORMAT,
|
||||||
stop_time);
|
stop_time);
|
||||||
gst_segment_set_stop (&self->segment, stop_time);
|
gst_segment_set_stop (&self->segment, stop_time);
|
||||||
|
|
Loading…
Reference in a new issue