diff options
author | Alex Converse <alex.converse@gmail.com> | 2010-06-21 04:05:09 +0000 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2010-06-21 04:05:09 +0000 |
commit | fda36b5944301f868ccacd5f1eacaa1e0374bc1b (patch) | |
tree | 6c495432aa2c90596f0446a8e1de652a626f0adb /libavcodec/aacdec.c | |
parent | 91a4abd8f544219ce85fb1b1ced9f1389d94faaa (diff) | |
download | ffmpeg-fda36b5944301f868ccacd5f1eacaa1e0374bc1b.tar.gz |
aacdec: Handle the first frame being empty case.
Originally committed as revision 23673 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/aacdec.c')
-rw-r--r-- | libavcodec/aacdec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 3c409a69cf..5079f5d44a 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -1985,7 +1985,7 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data, enum RawDataBlockType elem_type, elem_type_prev = TYPE_END; int err, elem_id, data_size_tmp; int buf_consumed; - int samples = 1024, multiplier; + int samples = 0, multiplier; int buf_offset; init_get_bits(&gb, buf, buf_size * 8); @@ -2011,6 +2011,9 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data, return -1; } + if (elem_type < TYPE_DSE) + samples = 1024; + switch (elem_type) { case TYPE_SCE: @@ -2093,6 +2096,7 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data, } *data_size = data_size_tmp; + if (samples) ac->dsp.float_to_int16_interleave(data, (const float **)ac->output_data, samples, avctx->channels); if (ac->output_configured) |