[FFmpeg-soc] [soc]: r2458 - wmapro/wma3dec.c

faust3 subversion at mplayerhq.hu
Sun Jun 15 17:05:00 CEST 2008


Author: faust3
Date: Sun Jun 15 17:05:00 2008
New Revision: 2458

Log:
fixed the broken cross frame concatenation code

Modified:
   wmapro/wma3dec.c

Modified: wmapro/wma3dec.c
==============================================================================
--- wmapro/wma3dec.c	(original)
+++ wmapro/wma3dec.c	Sun Jun 15 17:05:00 2008
@@ -203,11 +203,11 @@ static void save_bits(WMA3DecodeContext 
 
     /* byte align prev_frame buffer */
     if(bit_offset){
-        if(len > bit_offset)
-            s->prev_frame[pos++] |= get_bits(&s->gb,bit_offset);
-        else
-            s->prev_frame[pos++] |= get_bits(&s->gb,len) << (bit_offset - len);
-        len -= bit_offset;
+        int missing = 8 - bit_offset;
+        if(len < missing)
+            missing = len;
+        s->prev_frame[pos++] |= get_bits(&s->gb, missing) << (8 - bit_offset - missing);
+        len -= missing;
     }
 
     /* copy full bytes */
@@ -217,9 +217,8 @@ static void save_bits(WMA3DecodeContext 
     }
 
     /* copy remaining bits */
-    if(len > 0){
-        s->prev_frame[pos++] |= get_bits(&s->gb,len) << (8 - len);
-    }
+    if(len > 0)
+        s->prev_frame[pos++] = get_bits(&s->gb,len) << (8 - len);
 }
 
 static int wma3_decode_packet(AVCodecContext *avctx,



More information about the FFmpeg-soc mailing list