diff options
author | Mans Rullgard <mans@mansr.com> | 2012-06-17 11:45:10 +0100 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2012-07-04 03:30:43 +0100 |
commit | d155b60fc8ec8b1e7fa9cf3b0fa9eb826efefab7 (patch) | |
tree | 3b053804ce1b874c306b90afffea2f868ddedfa3 /libavcodec/flacenc.c | |
parent | 93e7ef9a2472d64d550ba1cf0e7a6f206fbc8dfd (diff) | |
download | ffmpeg-d155b60fc8ec8b1e7fa9cf3b0fa9eb826efefab7.tar.gz |
flac: make FLAC_CHMODE_* constants consecutive
Diffstat (limited to 'libavcodec/flacenc.c')
-rw-r--r-- | libavcodec/flacenc.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 7a532495b9..e2a370507a 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -1001,15 +1001,8 @@ static int estimate_stereo_mode(int32_t *left_ch, int32_t *right_ch, int n) for (i = 1; i < 4; i++) if (score[i] < score[best]) best = i; - if (best == 0) { - return FLAC_CHMODE_INDEPENDENT; - } else if (best == 1) { - return FLAC_CHMODE_LEFT_SIDE; - } else if (best == 2) { - return FLAC_CHMODE_RIGHT_SIDE; - } else { - return FLAC_CHMODE_MID_SIDE; - } + + return best; } @@ -1081,7 +1074,7 @@ static void write_frame_header(FlacEncodeContext *s) if (frame->ch_mode == FLAC_CHMODE_INDEPENDENT) put_bits(&s->pb, 4, s->channels-1); else - put_bits(&s->pb, 4, frame->ch_mode); + put_bits(&s->pb, 4, frame->ch_mode + FLAC_MAX_CHANNELS - 1); put_bits(&s->pb, 3, 4); /* bits-per-sample code */ put_bits(&s->pb, 1, 0); |