[FFmpeg-devel] [PATCH 1/4] wavpackenc: fix number of samples per block

Christophe Gisquet christophe.gisquet at gmail.com
Fri Aug 22 11:31:42 CEST 2014


Currently, the encoder will try to reduce it down to 150000, but the
decoder will complain starting at 131072 (WV_MAX_SAMPLES). Therefore,
change the loop limit.

Fixes ticket #3881.
---
 libavcodec/wavpackenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c
index 3631a08..169836a 100644
--- a/libavcodec/wavpackenc.c
+++ b/libavcodec/wavpackenc.c
@@ -135,7 +135,7 @@ static av_cold int wavpack_encode_init(AVCodecContext *avctx)
         else
             block_samples = avctx->sample_rate;
 
-        while (block_samples * avctx->channels > 150000)
+        while (block_samples * avctx->channels > WV_MAX_SAMPLES)
             block_samples /= 2;
 
         while (block_samples * avctx->channels < 40000)
-- 
1.9.2.msysgit.0



More information about the ffmpeg-devel mailing list