summaryrefslogtreecommitdiffstats
path: root/gst/selector/gstinputselector.c
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@noraisin.net>2009-04-23 11:04:46 +0100
committerDave Robillard <dave@drobilla.net>2009-05-03 12:03:17 -0400
commit7aae742e64cb0f98e3890deefcd63105dbdc148e (patch)
tree649d9cf6b0fa47087b6a5bb95c4f724d39a0f9f9 /gst/selector/gstinputselector.c
parentf90b589e5e2853d5a91d37b2308cd00e95ae55c5 (diff)
downloadgst-plugins-bad-7aae742e64cb0f98e3890deefcd63105dbdc148e.tar.gz
gst-plugins-bad-7aae742e64cb0f98e3890deefcd63105dbdc148e.tar.bz2
gst-plugins-bad-7aae742e64cb0f98e3890deefcd63105dbdc148e.zip
input-selector: Forward segment events for the active pad immediately.
When a segment event is received on the active pad, forward it downstream immediately instead of deferring it until the next data buffer arrives. This fixes problems with segment updates never being sent downstream, like those needed for sparse streams, or for closing previously opened segments. This fixes playback of DVD menus with a still video frame and an audio track, for example. Fixes: #577843
Diffstat (limited to 'gst/selector/gstinputselector.c')
-rw-r--r--gst/selector/gstinputselector.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gst/selector/gstinputselector.c b/gst/selector/gstinputselector.c
index 7a458b0f..08d3d497 100644
--- a/gst/selector/gstinputselector.c
+++ b/gst/selector/gstinputselector.c
@@ -392,12 +392,17 @@ gst_selector_pad_event (GstPad * pad, GstEvent * event)
gst_segment_set_newsegment_full (&selpad->segment, update,
rate, arate, format, start, stop, time);
GST_OBJECT_UNLOCK (selpad);
- /* we are not going to forward the segment, mark the segment as
- * pending */
- forward = FALSE;
- selpad->segment_pending = TRUE;
- GST_INPUT_SELECTOR_UNLOCK (sel);
+ /* If we aren't forwarding the event (because the pad is not the
+ * active_sinkpad, and select_all is not set, then set the flag on the
+ * that says a segment needs sending if/when that pad is activated.
+ * For all other cases, we send the event immediately, which makes
+ * sparse streams and other segment updates work correctly downstream.
+ */
+ if (!forward)
+ selpad->segment_pending = TRUE;
+
+ GST_INPUT_SELECTOR_UNLOCK (sel);
break;
}
case GST_EVENT_TAG: