changeset 11902:c883aa4aa616 libavcodec

aacdec: Handle the first frame being empty case.
author alexc
date Mon, 21 Jun 2010 04:05:09 +0000
parents 829dadee50c8
children f3e007b379e5
files aacdec.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/aacdec.c	Sun Jun 20 23:03:32 2010 +0000
+++ b/aacdec.c	Mon Jun 21 04:05:09 2010 +0000
@@ -1985,7 +1985,7 @@
     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 @@
             return -1;
         }
 
+        if (elem_type < TYPE_DSE)
+            samples = 1024;
+
         switch (elem_type) {
 
         case TYPE_SCE:
@@ -2093,6 +2096,7 @@
     }
     *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)