From 0c9b13988c6f7c1e4010179c9f781ca860e475e0 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 12 May 2008 08:45:11 +0000 Subject: [PATCH] gst-libs/gst/audio/gstbaseaudiosink.c: Revert previous patch that attempted to more accurately calculate the initial ... Original commit message from CVS: * gst-libs/gst/audio/gstbaseaudiosink.c: (gst_base_audio_sink_render), (gst_base_audio_sink_async_play): Revert previous patch that attempted to more accurately calculate the initial offset between master and slave clock. The best thing we can do in general is take the time of both clocks as the diff since we don't know when the actual preroll happened. --- ChangeLog | 9 +++++++++ gst-libs/gst/audio/gstbaseaudiosink.c | 14 ++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 235e4c1e9d..dcf603d835 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-05-12 Wim Taymans + + * gst-libs/gst/audio/gstbaseaudiosink.c: + (gst_base_audio_sink_render), (gst_base_audio_sink_async_play): + Revert previous patch that attempted to more accurately calculate the + initial offset between master and slave clock. The best thing we can do + in general is take the time of both clocks as the diff since we don't + know when the actual preroll happened. + 2008-05-11 Tim-Philipp Müller * gst-libs/gst/pbutils/install-plugins.c: diff --git a/gst-libs/gst/audio/gstbaseaudiosink.c b/gst-libs/gst/audio/gstbaseaudiosink.c index 82abaf4cc5..6a7addf04b 100644 --- a/gst-libs/gst/audio/gstbaseaudiosink.c +++ b/gst-libs/gst/audio/gstbaseaudiosink.c @@ -1419,21 +1419,15 @@ gst_base_audio_sink_async_play (GstBaseSink * basesink) /* if we are slaved to a clock, we need to set the initial * calibration */ - /* get external and internal time to set as calibration params */ - etime = GST_ELEMENT_CAST (sink)->base_time; - itime = gst_base_audio_sink_get_time (sink->provided_clock, sink); - switch (sink->priv->slave_method) { case GST_BASE_AUDIO_SINK_SLAVE_SKEW: case GST_BASE_AUDIO_SINK_SLAVE_RESAMPLE: - /* adjust with upstream latency, when we are prerolled, our internal clock - * should exactly have been the time of the upstream latency */ - etime += sink->priv->us_latency; - break; case GST_BASE_AUDIO_SINK_SLAVE_NONE: - /* no slaving, base_time corresponds to our 0 time */ - itime = 0; default: + /* When we are prerolled, our internal clock should exactly have been the time + * of the external clock */ + etime = gst_clock_get_time (clock); + itime = gst_base_audio_sink_get_time (sink->provided_clock, sink); break; } GST_DEBUG_OBJECT (sink,