From a7ce550d04071b31b600339262deca41cda8ad71 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Sat, 8 Oct 2011 20:11:22 +0200 Subject: [PATCH] audiodecoder: fix timestamp tolerance handling --- gst-libs/gst/audio/gstaudiodecoder.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c index 32cbc61aaa..ca9dfd2885 100644 --- a/gst-libs/gst/audio/gstaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@ -792,17 +792,17 @@ gst_audio_decoder_finish_frame (GstAudioDecoder * dec, GstBuffer * buf, g_assert (GST_CLOCK_TIME_IS_VALID (priv->base_ts)); next_ts = priv->base_ts + - gst_util_uint64_scale (samples, GST_SECOND, ctx->info.rate); + gst_util_uint64_scale (priv->samples, GST_SECOND, ctx->info.rate); GST_LOG_OBJECT (dec, "buffer is %d samples past base_ts %" GST_TIME_FORMAT - ", expected ts %" GST_TIME_FORMAT, samples, + ", expected ts %" GST_TIME_FORMAT, priv->samples, GST_TIME_ARGS (priv->base_ts), GST_TIME_ARGS (next_ts)); diff = GST_CLOCK_DIFF (next_ts, ts); GST_LOG_OBJECT (dec, "ts diff %d ms", (gint) (diff / GST_MSECOND)); /* if within tolerance, * discard buffer ts and carry on producing perfect stream, * otherwise resync to ts */ - if (G_UNLIKELY (diff < -dec->priv->tolerance || - diff > dec->priv->tolerance)) { + if (G_UNLIKELY (diff < (gint64) - dec->priv->tolerance || + diff > (gint64) dec->priv->tolerance)) { GST_DEBUG_OBJECT (dec, "base_ts resync"); priv->base_ts = ts; priv->samples = 0;