aboutsummaryrefslogtreecommitdiffstats
path: root/avconv.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-03-21 16:56:49 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-03-23 01:19:43 -0400
commit4094fc9971058b5a11c38d3294141c3220a2b691 (patch)
tree0179fc617be7169336ae2e332592e660b06b2f8a /avconv.c
parent9869e963a6a6bd3a8bd118cee698df08d84cbfba (diff)
downloadffmpeg-4094fc9971058b5a11c38d3294141c3220a2b691.tar.gz
avconv: fix the resampling safety factors for output audio buffer allocation
This matches the output size required for audio_resample()
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/avconv.c b/avconv.c
index d3f9540d04..b83662c893 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1020,7 +1020,7 @@ static int alloc_audio_output_buf(AVCodecContext *dec, AVCodecContext *enc,
/* calculate required number of samples to allocate */
audio_buf_samples = ((int64_t)nb_samples * enc->sample_rate + dec->sample_rate) /
dec->sample_rate;
- audio_buf_samples = audio_buf_samples * 2 + 10000; // safety factors for the deprecated resampling API
+ audio_buf_samples = 4 * audio_buf_samples + 16; // safety factors for resampling
audio_buf_samples = FFMAX(audio_buf_samples, enc->frame_size);
if (audio_buf_samples > INT_MAX)
return AVERROR(EINVAL);