Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2011-04-23 15:37:28 +0400
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2011-04-23 15:37:28 +0400
commit2ef2496cd19eb833f4ad22a5051c11be80d09598 (patch)
tree923e7925db6e22af38ff789be542aabfbc8622f1 /libavcodec/flac.c
parent539647c6ffa9c39f60cee41e1eb79e491bc4f4c5 (diff)
Set channel layout in flac decoder.
Diffstat (limited to 'libavcodec/flac.c')
-rw-r--r--libavcodec/flac.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/flac.c b/libavcodec/flac.c
index 484a44efb3..6e94c2c5ff 100644
--- a/libavcodec/flac.c
+++ b/libavcodec/flac.c
@@ -22,6 +22,7 @@
#include "libavutil/crc.h"
#include "flac.h"
#include "flacdata.h"
+#include "vorbis.h"
static const int8_t sample_size_table[] = { 0, 8, 12, 0, 16, 20, 24, 0 };
@@ -54,6 +55,8 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb,
fi->ch_mode = get_bits(gb, 4);
if (fi->ch_mode < FLAC_MAX_CHANNELS) {
fi->channels = fi->ch_mode + 1;
+ if (fi->ch_mode <= 5)
+ avctx->channel_layout = ff_vorbis_channel_layouts[fi->ch_mode];
fi->ch_mode = FLAC_CHMODE_INDEPENDENT;
} else if (fi->ch_mode <= FLAC_CHMODE_MID_SIDE) {
fi->channels = 2;