mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 02:00:33 +00:00
baseaudiosink: Resync when ringbuffer resets
When the ringbuffer gets restarted (like in setcaps), we *will* have to resync against the new values. Without this we end up blindly assuming the new samples align to the old ones.
This commit is contained in:
parent
a476b6cbfb
commit
c9428c96b1
1 changed files with 6 additions and 0 deletions
|
@ -903,6 +903,12 @@ gst_audio_base_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
||||||
if (!gst_audio_ring_buffer_acquire (sink->ringbuffer, spec))
|
if (!gst_audio_ring_buffer_acquire (sink->ringbuffer, spec))
|
||||||
goto acquire_error;
|
goto acquire_error;
|
||||||
|
|
||||||
|
/* We need to resync since the ringbuffer restarted */
|
||||||
|
sink->priv->avg_skew = -1;
|
||||||
|
sink->next_sample = -1;
|
||||||
|
sink->priv->eos_time = -1;
|
||||||
|
sink->priv->discont_time = -1;
|
||||||
|
|
||||||
if (bsink->pad_mode == GST_PAD_MODE_PUSH) {
|
if (bsink->pad_mode == GST_PAD_MODE_PUSH) {
|
||||||
GST_DEBUG_OBJECT (sink, "activate ringbuffer");
|
GST_DEBUG_OBJECT (sink, "activate ringbuffer");
|
||||||
gst_audio_ring_buffer_activate (sink->ringbuffer, TRUE);
|
gst_audio_ring_buffer_activate (sink->ringbuffer, TRUE);
|
||||||
|
|
Loading…
Reference in a new issue