summaryrefslogtreecommitdiff
path: root/gst/playback/gststreamsynchronizer.c
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2012-10-24 13:34:15 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-10-24 13:34:15 +0200
commitb9d4d0cd2980ad38adcdf3851f1e389a7b52ca6b (patch)
tree4882b5ae83726c4a2d03760e196bc84ea34fd905 /gst/playback/gststreamsynchronizer.c
parent6a31051febe219be5a701ed8822d6a4341493625 (diff)
streamsynchronizer: Also send a GAP event to let audio sinks start their clock in case they did not have enough data yet
Diffstat (limited to 'gst/playback/gststreamsynchronizer.c')
-rw-r--r--gst/playback/gststreamsynchronizer.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gst/playback/gststreamsynchronizer.c b/gst/playback/gststreamsynchronizer.c
index b37382c3c..fbae33727 100644
--- a/gst/playback/gststreamsynchronizer.c
+++ b/gst/playback/gststreamsynchronizer.c
@@ -418,7 +418,9 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent,
seen_data = stream->seen_data;
srcpad = gst_object_ref (stream->srcpad);
- if (stream->segment.rate < 0.0 || stream->segment.stop == -1)
+ if (seen_data && stream->segment.position != -1)
+ timestamp = stream->segment.position;
+ else if (stream->segment.rate < 0.0 || stream->segment.stop == -1)
timestamp = stream->segment.start;
else
timestamp = stream->segment.stop;
@@ -465,7 +467,12 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent,
gap_event = gst_event_new_gap (timestamp, GST_CLOCK_TIME_NONE);
ret = gst_pad_push_event (srcpad, gap_event);
} else {
- ret = TRUE;
+ GstEvent *gap_event;
+
+ /* FIXME: Also send a GAP event to let audio sinks start their
+ * clock in case they did not have enough data yet */
+ gap_event = gst_event_new_gap (timestamp, GST_CLOCK_TIME_NONE);
+ ret = gst_pad_push_event (srcpad, gap_event);
}
}
gst_object_unref (srcpad);