[FFmpeg-soc] [soc]: r4299 - in wmapro: wma3.h wma3dec.c

faust3 subversion at mplayerhq.hu
Sat May 23 12:54:22 CEST 2009


Author: faust3
Date: Sat May 23 12:54:21 2009
New Revision: 4299

Log:
get rid of the unexpected number of padding bits assertion

Modified:
   wmapro/wma3.h
   wmapro/wma3dec.c

Modified: wmapro/wma3.h
==============================================================================
--- wmapro/wma3.h	Sat May 23 12:45:52 2009	(r4298)
+++ wmapro/wma3.h	Sat May 23 12:54:21 2009	(r4299)
@@ -36,6 +36,7 @@
 #define MAX_SUBFRAMES  32                                    ///< max number of subframes per channel
 #define MAX_BANDS      29                                    ///< max number of scale factor bands
 #define MAX_FRAMESIZE  16384                                 ///< maximum compressed frame size
+#define MAX_FRAMEBITS  (MAX_FRAMESIZE << 3)                  ///< maximum frame size in bits
 
 /* size of block defines taken from wma.h */
 #define BLOCK_MIN_BITS  7                                    ///< log2 of min block size

Modified: wmapro/wma3dec.c
==============================================================================
--- wmapro/wma3dec.c	Sat May 23 12:45:52 2009	(r4298)
+++ wmapro/wma3dec.c	Sat May 23 12:54:21 2009	(r4299)
@@ -28,8 +28,6 @@
 #include "avcodec.h"
 #include "get_bits.h"
 #include "wma3.h"
-#undef NDEBUG
-#include <assert.h>
 
 #define VLCBITS            9
 #define SCALEVLCBITS       8
@@ -1453,11 +1451,12 @@ static int wma_decode_frame(WMA3DecodeCo
     else
         s->samples += s->num_channels * s->samples_per_frame;
 
-
-    // FIXME: remove
-    av_log(s->avctx,AV_LOG_DEBUG,"frame[%i] skipping %i bits\n",s->frame_num,len - (get_bits_count(gb) - s->frame_offset) - 1);
-    if(len != (get_bits_count(gb) - s->frame_offset) + 2)
-        assert(0);
+    if(len != (get_bits_count(gb) - s->frame_offset) + 2){
+        /* FIXME: not sure if this is always an error */
+        av_log(s->avctx,AV_LOG_ERROR,"frame[%i] would have to skip %i bits\n",s->frame_num,len - (get_bits_count(gb) - s->frame_offset) - 1);
+        s->packet_loss = 1;
+        return 0;
+    }
 
     /** skip the rest of the frame data */
     skip_bits_long(gb,len - (get_bits_count(gb) - s->frame_offset) - 1);


More information about the FFmpeg-soc mailing list