summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward.hervey@collabora.co.uk>2012-07-10 18:32:13 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-12-03 16:50:40 +0100
commit969fe8c0b97ae4ac58aacf7530ca1bfbc2b5969a (patch)
tree6660268e17d90a12ec58b04506eab673dabcd48d
parent464a8347742bcd1bc547d19e64c4ef7034ac5a76 (diff)
downloadgstreamer-plugins-base-969fe8c0b97ae4ac58aacf7530ca1bfbc2b5969a.tar.gz
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. Conflicts: gst-libs/gst/audio/gstbaseaudiosink.c
-rw-r--r--gst-libs/gst/audio/gstbaseaudiosink.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gst-libs/gst/audio/gstbaseaudiosink.c b/gst-libs/gst/audio/gstbaseaudiosink.c
index 03e332dee..fe89c9d22 100644
--- a/gst-libs/gst/audio/gstbaseaudiosink.c
+++ b/gst-libs/gst/audio/gstbaseaudiosink.c
@@ -921,6 +921,12 @@ gst_base_audio_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
if (!gst_ring_buffer_acquire (sink->ringbuffer, spec))
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_ACTIVATE_PUSH) {
GST_DEBUG_OBJECT (sink, "activate ringbuffer");
gst_ring_buffer_activate (sink->ringbuffer, TRUE);