summaryrefslogtreecommitdiffstats
path: root/libhb/encavcodecaudio.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2013-03-16 16:59:35 +0000
committerjstebbins <[email protected]>2013-03-16 16:59:35 +0000
commit7ee0ec4613c8af58bb9d0aaf5fd02cef2d0e518c (patch)
tree3ca6b92c71c3a119736e1aeb356176a7f341a1d7 /libhb/encavcodecaudio.c
parent8caf161063b9589e7a0a4795f424f3c9df92b0ef (diff)
libhb: fix fdk-aac mono encoding
A minimum output buffer size of 8KB is needed by libav git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5329 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encavcodecaudio.c')
-rw-r--r--libhb/encavcodecaudio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libhb/encavcodecaudio.c b/libhb/encavcodecaudio.c
index 2c4471bab..3633fed9e 100644
--- a/libhb/encavcodecaudio.c
+++ b/libhb/encavcodecaudio.c
@@ -189,8 +189,10 @@ static int encavcodecaInit(hb_work_object_t *w, hb_job_t *job)
pv->samples_per_frame = context->frame_size;
pv->input_samples = context->frame_size * context->channels;
pv->input_buf = malloc(pv->input_samples * sizeof(float));
- pv->max_output_bytes = (pv->input_samples *
- av_get_bytes_per_sample(context->sample_fmt));
+ // Some encoders in libav (e.g. fdk-aac) fail if the output buffer
+ // size is not some minumum value. 8K seems to be enough :(
+ pv->max_output_bytes = MAX(8192, (pv->input_samples *
+ av_get_bytes_per_sample(context->sample_fmt)));
// sample_fmt conversion
if (context->sample_fmt != AV_SAMPLE_FMT_FLT)