Skip to content

Commit

Permalink
baseaudiosink: Resync when ringbuffer resets
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Edward Hervey authored and adenexter committed May 8, 2014
1 parent 8daf4ab commit bb14a34
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gst-plugins-base/gst-libs/gst/audio/gstbaseaudiosink.c
Expand Up @@ -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);
Expand Down

0 comments on commit bb14a34

Please sign in to comment.