X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Falsdec.c;h=13bd52f297ff1a7672374e038347bee6eba3827a;hb=bf209013bff8f70facd9eada39009eff05f8e202;hp=d95e30d10d3f2f260b710446a5fa1bbcc13139b4;hpb=a8ad127a63ab6348050bfade358facae68f39a2a;p=ffmpeg diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index d95e30d10d3..13bd52f297f 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -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) {