changeset 33109:01b19cf2649c

Fix segfault in lavcac3enc audio filter. The FFmpeg ac3 encoder would fail to open if the correct sample format is not set. As the opening is done in control() the audio filter would not fail back, but would instead continue and call encoding functions that dereference NULL pointer.
author iive
date Sun, 03 Apr 2011 14:39:27 +0000
parents 5450a92ac4bd
children edfad5286e00
files libaf/af_lavcac3enc.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libaf/af_lavcac3enc.c	Sun Apr 03 14:26:38 2011 +0000
+++ b/libaf/af_lavcac3enc.c	Sun Apr 03 14:39:27 2011 +0000
@@ -95,6 +95,7 @@
             // Put sample parameters
             s->lavc_actx->channels = af->data->nch;
             s->lavc_actx->sample_rate = af->data->rate;
+            s->lavc_actx->sample_fmt  = AV_SAMPLE_FMT_S16;
             s->lavc_actx->bit_rate = bit_rate;
 
             if(avcodec_open(s->lavc_actx, s->lavc_acodec) < 0) {