From b9d4d0cd2980ad38adcdf3851f1e389a7b52ca6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 24 Oct 2012 13:34:15 +0200 Subject: [PATCH] streamsynchronizer: Also send a GAP event to let audio sinks start their clock in case they did not have enough data yet --- gst/playback/gststreamsynchronizer.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gst/playback/gststreamsynchronizer.c b/gst/playback/gststreamsynchronizer.c index b37382c3c5..fbae337277 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);