aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/flac.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-06-17 11:45:10 +0100
committerMans Rullgard <mans@mansr.com>2012-07-04 03:30:43 +0100
commitd155b60fc8ec8b1e7fa9cf3b0fa9eb826efefab7 (patch)
tree3b053804ce1b874c306b90afffea2f868ddedfa3 /libavcodec/flac.c
parent93e7ef9a2472d64d550ba1cf0e7a6f206fbc8dfd (diff)
downloadffmpeg-d155b60fc8ec8b1e7fa9cf3b0fa9eb826efefab7.tar.gz
flac: make FLAC_CHMODE_* constants consecutive
Diffstat (limited to 'libavcodec/flac.c')
-rw-r--r--libavcodec/flac.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/flac.c b/libavcodec/flac.c
index e6a427af11..ac36376cdc 100644
--- a/libavcodec/flac.c
+++ b/libavcodec/flac.c
@@ -55,8 +55,9 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb,
if (fi->ch_mode < FLAC_MAX_CHANNELS) {
fi->channels = fi->ch_mode + 1;
fi->ch_mode = FLAC_CHMODE_INDEPENDENT;
- } else if (fi->ch_mode <= FLAC_CHMODE_MID_SIDE) {
+ } else if (fi->ch_mode < FLAC_MAX_CHANNELS + FLAC_CHMODE_MID_SIDE) {
fi->channels = 2;
+ fi->ch_mode -= FLAC_MAX_CHANNELS - 1;
} else {
av_log(avctx, AV_LOG_ERROR + log_level_offset,
"invalid channel mode: %d\n", fi->ch_mode);