]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/alsdec.c
Merge commit 'c43a96fe16e6a6ea091e64ca271f0788f4a0bea9'
[ffmpeg] / libavcodec / alsdec.c
index d95e30d10d3f2f260b710446a5fa1bbcc13139b4..13bd52f297ff1a7672374e038347bee6eba3827a 100644 (file)
@@ -31,7 +31,6 @@
 #include "get_bits.h"
 #include "unary.h"
 #include "mpeg4audio.h"
-#include "bytestream.h"
 #include "bgmc.h"
 #include "bswapdsp.h"
 #include "internal.h"
@@ -762,7 +761,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
             }
 
             for (k = 2; k < opt_order; k++)
-                quant_cof[k] = (quant_cof[k] << 14) + (add_base << 13);
+                quant_cof[k] = (quant_cof[k] * (1 << 14)) + (add_base << 13);
         }
     }
 
@@ -867,7 +866,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
                     res >>= 1;
 
                     if (cur_k) {
-                        res <<= cur_k;
+                        res  *= 1 << cur_k;
                         res  |= get_bits_long(gb, cur_k);
                     }
                 }
@@ -1637,7 +1636,7 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
                     independent_bs = 2;
 
             // if this is the last channel, it has to be decoded independently
-            if (c == avctx->channels - 1)
+            if (c == avctx->channels - 1 || (c & 1))
                 independent_bs = 1;
 
             if (independent_bs) {