From c8cfaff1ff03c2c1f6670280cc311fdf118a2a20 Mon Sep 17 00:00:00 2001 From: Sebastian Dröge Date: Wed, 10 Jul 2013 14:30:31 +0200 Subject: inputselector: Keep previous active sinkpad around until we're done with it Otherwise we'll send a new segment event downstream for each buffer. --- plugins/elements/gstinputselector.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'plugins/elements/gstinputselector.c') diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c index 9caf5f1c9..6fcda9347 100644 --- a/plugins/elements/gstinputselector.c +++ b/plugins/elements/gstinputselector.c @@ -504,6 +504,7 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event) gst_event_set_seqnum (event, selpad->segment_seqnum); } } + GST_DEBUG_OBJECT (pad, "configured SEGMENT %" GST_SEGMENT_FORMAT, &selpad->segment); break; @@ -1037,9 +1038,6 @@ gst_selector_pad_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) g_object_notify (G_OBJECT (active_sinkpad), "active"); g_object_notify (G_OBJECT (sel), "active-pad"); } - if (prev_active_sinkpad) - gst_object_unref (prev_active_sinkpad); - prev_active_sinkpad = NULL; /* if we have a pending events, push them now */ if (G_UNLIKELY (prev_active_sinkpad != active_sinkpad @@ -1049,6 +1047,10 @@ gst_selector_pad_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) selpad->events_pending = FALSE; } + if (prev_active_sinkpad) + gst_object_unref (prev_active_sinkpad); + prev_active_sinkpad = NULL; + if (selpad->discont) { buf = gst_buffer_make_writable (buf); -- cgit v1.2.3