summaryrefslogtreecommitdiff
path: root/libavcodec/alac.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2007-07-13 00:06:46 +0000
committerVitor Sessak <vitor1001@gmail.com>2007-07-13 00:06:46 +0000
commite3be5693c3e9e4e48106df957e309bd8e04b568f (patch)
treeb881f27b7b0615cae30ca869012753ed7bec2df9 /libavcodec/alac.c
parent7c8b273bbe4e86bedf8814f0318b329691d726b9 (diff)
Make "channels" variable mean the number of channels, not the number of
channels minus one Originally committed as revision 9617 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/alac.c')
-rw-r--r--libavcodec/alac.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index e648f9548b..b281024f0d 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -487,7 +487,7 @@ static int alac_decode_frame(AVCodecContext *avctx,
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.
* perhaps matters if we read > 1 frame in a pass?
@@ -510,10 +510,10 @@ static int alac_decode_frame(AVCodecContext *avctx,
outputsamples = alac->setinfo_max_samples_per_frame;
*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) {
- case 0: { /* 1 channel */
+ case 1: { /* 1 channel */
int ricemodifier;
if (!isnotcompressed) {
@@ -624,7 +624,7 @@ static int alac_decode_frame(AVCodecContext *avctx,
}
break;
}
- case 1: { /* 2 channels */
+ case 2: { /* 2 channels */
uint8_t interlacing_shift;
uint8_t interlacing_leftweight;