mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-13 10:55:34 +00:00
baseaudiosink: recalibrate clock on setcaps
Because the spec for the ringbuffer can change when changing the caps, we must recalibrate the clock. https://bugzilla.gnome.org/show_bug.cgi?id=610443
This commit is contained in:
parent
c867f677c0
commit
dad50ad1fe
1 changed files with 8 additions and 0 deletions
|
@ -727,6 +727,7 @@ gst_base_audio_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
|||
GstBaseAudioSink *sink = GST_BASE_AUDIO_SINK (bsink);
|
||||
GstRingBufferSpec *spec;
|
||||
GstClockTime now;
|
||||
GstClockTime crate_num, crate_denom;
|
||||
|
||||
if (!sink->ringbuffer)
|
||||
return FALSE;
|
||||
|
@ -765,6 +766,13 @@ gst_base_audio_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
|||
gst_ring_buffer_activate (sink->ringbuffer, TRUE);
|
||||
}
|
||||
|
||||
/* due to possible changes in the spec file we should recalibrate the clock */
|
||||
gst_clock_get_calibration (sink->provided_clock, NULL, NULL,
|
||||
&crate_num, &crate_denom);
|
||||
gst_clock_set_calibration (sink->provided_clock,
|
||||
gst_clock_get_internal_time (sink->provided_clock), now, crate_num,
|
||||
crate_denom);
|
||||
|
||||
/* calculate actual latency and buffer times.
|
||||
* FIXME: In 0.11, store the latency_time internally in ns */
|
||||
spec->latency_time = gst_util_uint64_scale (spec->segsize,
|
||||
|
|
Loading…
Reference in a new issue