Commit e9b667f4 authored by vitor's avatar vitor

Make "channels" variable mean the number of channels, not the number of

channels minus one


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@9617 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0be668c9
...@@ -487,7 +487,7 @@ static int alac_decode_frame(AVCodecContext *avctx, ...@@ -487,7 +487,7 @@ static int alac_decode_frame(AVCodecContext *avctx,
init_get_bits(&alac->gb, inbuffer, input_buffer_size * 8); init_get_bits(&alac->gb, inbuffer, input_buffer_size * 8);
channels = get_bits(&alac->gb, 3); channels = get_bits(&alac->gb, 3) + 1;
/* 2^result = something to do with output waiting. /* 2^result = something to do with output waiting.
* perhaps matters if we read > 1 frame in a pass? * perhaps matters if we read > 1 frame in a pass?
...@@ -510,10 +510,10 @@ static int alac_decode_frame(AVCodecContext *avctx, ...@@ -510,10 +510,10 @@ static int alac_decode_frame(AVCodecContext *avctx,
outputsamples = alac->setinfo_max_samples_per_frame; outputsamples = alac->setinfo_max_samples_per_frame;
*outputsize = outputsamples * alac->bytespersample; *outputsize = outputsamples * alac->bytespersample;
readsamplesize = alac->setinfo_sample_size - (wasted_bytes * 8) + channels; readsamplesize = alac->setinfo_sample_size - (wasted_bytes * 8) + channels - 1;
switch(channels) { switch(channels) {
case 0: { /* 1 channel */ case 1: { /* 1 channel */
int ricemodifier; int ricemodifier;
if (!isnotcompressed) { if (!isnotcompressed) {
...@@ -624,7 +624,7 @@ static int alac_decode_frame(AVCodecContext *avctx, ...@@ -624,7 +624,7 @@ static int alac_decode_frame(AVCodecContext *avctx,
} }
break; break;
} }
case 1: { /* 2 channels */ case 2: { /* 2 channels */
uint8_t interlacing_shift; uint8_t interlacing_shift;
uint8_t interlacing_leftweight; uint8_t interlacing_leftweight;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment