mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
baseaudiosink: subtract the render_delay from our latency
The latency reported by the base class includes the render_delay, which we don't want to include when we start slaving our clocks. See #630441
This commit is contained in:
parent
550d59354f
commit
c89082b2dd
1 changed files with 10 additions and 1 deletions
|
@ -1145,7 +1145,7 @@ gst_base_audio_sink_sync_latency (GstBaseSink * bsink, GstMiniObject * obj)
|
|||
{
|
||||
GstClock *clock;
|
||||
GstClockReturn status;
|
||||
GstClockTime time;
|
||||
GstClockTime time, render_delay;
|
||||
GstFlowReturn ret;
|
||||
GstBaseAudioSink *sink;
|
||||
GstClockTime itime, etime;
|
||||
|
@ -1175,6 +1175,15 @@ gst_base_audio_sink_sync_latency (GstBaseSink * bsink, GstMiniObject * obj)
|
|||
time = sink->priv->us_latency;
|
||||
GST_OBJECT_UNLOCK (sink);
|
||||
|
||||
/* Renderdelay is added onto our own latency, and needs
|
||||
* to be subtracted as well */
|
||||
render_delay = gst_base_sink_get_render_delay (bsink);
|
||||
|
||||
if (G_LIKELY (time > render_delay))
|
||||
time -= render_delay;
|
||||
else
|
||||
time = 0;
|
||||
|
||||
/* preroll done, we can sync since we are in PLAYING now. */
|
||||
GST_DEBUG_OBJECT (sink, "possibly waiting for clock to reach %"
|
||||
GST_TIME_FORMAT, GST_TIME_ARGS (time));
|
||||
|
|
Loading…
Reference in a new issue