From f6ea21779240cf09e0c730febad6a0d0d5393999 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Wed, 10 Feb 2010 22:14:07 +0100 Subject: [PATCH] faad: correctly estimate average bps Count consumed bytes and corresponding duration atomically, rather than letting bytecount run ahead of what has been decoded. Fixes #440476. --- ext/faad/gstfaad.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ext/faad/gstfaad.c b/ext/faad/gstfaad.c index 1b570922b3..4f0fca6bb8 100644 --- a/ext/faad/gstfaad.c +++ b/ext/faad/gstfaad.c @@ -1002,10 +1002,6 @@ gst_faad_chain (GstPad * pad, GstBuffer * buffer) faad->discont = TRUE; } - GST_OBJECT_LOCK (faad); - faad->bytes_in += GST_BUFFER_SIZE (buffer); - GST_OBJECT_UNLOCK (faad); - gst_adapter_push (faad->adapter, buffer); buffer = NULL; @@ -1151,6 +1147,7 @@ gst_faad_chain (GstPad * pad, GstBuffer * buffer) GST_OBJECT_LOCK (faad); faad->next_ts += GST_BUFFER_DURATION (outbuf); faad->sum_dur_out += GST_BUFFER_DURATION (outbuf); + faad->bytes_in += info.bytesconsumed; GST_OBJECT_UNLOCK (faad); if ((outbuf = gst_audio_buffer_clip (outbuf, &faad->segment,