summaryrefslogtreecommitdiff
path: root/gst/selector
diff options
context:
space:
mode:
authorMichael Smith <msmith@xiph.org>2008-12-04 17:51:37 +0000
committerMichael Smith <msmith@xiph.org>2008-12-04 17:51:37 +0000
commit7f57d31ff9e2d561e58b75dea49aa072275ba52e (patch)
tree35f6b191b66ca28734124d91b130fddd8f06ba6a /gst/selector
parentb52069748fa56cc0b09a00bcc6845df43681a11e (diff)
downloadgstreamer-plugins-bad-7f57d31ff9e2d561e58b75dea49aa072275ba52e.tar.gz
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
Diffstat (limited to 'gst/selector')
-rw-r--r--gst/selector/gstinputselector.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gst/selector/gstinputselector.c b/gst/selector/gstinputselector.c
index c175a5e02..b55838ab8 100644
--- a/gst/selector/gstinputselector.c
+++ b/gst/selector/gstinputselector.c
@@ -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);