diff options
author | ulion <ulion@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-10-09 07:46:20 +0000 |
---|---|---|
committer | ulion <ulion@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-10-09 07:46:20 +0000 |
commit | 78f37058ff6658656f52fe6c82debb48723ba439 (patch) | |
tree | 680e402e225bba75d48f9a61bc380527dae8b654 | |
parent | 74bb6be453fb896a48d16254cf55449b58052d0b (diff) |
Fix channel order for ffmpeg flac codec.
This patch comes from Andrew de Quincey <adq_dvb at lidskialf dot net>.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27732 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libaf/reorder_ch.c | 2 | ||||
-rw-r--r-- | libaf/reorder_ch.h | 5 | ||||
-rw-r--r-- | libmpcodecs/ad_ffmpeg.c | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/libaf/reorder_ch.c b/libaf/reorder_ch.c index 4eb968842b..1ef05f4838 100644 --- a/libaf/reorder_ch.c +++ b/libaf/reorder_ch.c @@ -1109,6 +1109,7 @@ static int channel_layout_mapping_5ch[AF_CHANNEL_LAYOUT_SOURCE_NUM] = { AF_CHANNEL_LAYOUT_LAVC_LIBA52_5CH_DEFAULT, AF_CHANNEL_LAYOUT_LAVC_DCA_5CH_DEFAULT, AF_CHANNEL_LAYOUT_VORBIS_5CH_DEFAULT, + AF_CHANNEL_LAYOUT_FLAC_5CH_DEFAULT, }; static int channel_layout_mapping_6ch[AF_CHANNEL_LAYOUT_SOURCE_NUM] = { @@ -1119,6 +1120,7 @@ static int channel_layout_mapping_6ch[AF_CHANNEL_LAYOUT_SOURCE_NUM] = { AF_CHANNEL_LAYOUT_LAVC_LIBA52_6CH_DEFAULT, AF_CHANNEL_LAYOUT_LAVC_DCA_6CH_DEFAULT, AF_CHANNEL_LAYOUT_VORBIS_6CH_DEFAULT, + AF_CHANNEL_LAYOUT_FLAC_6CH_DEFAULT, }; void reorder_channel_copy_nch(void *src, diff --git a/libaf/reorder_ch.h b/libaf/reorder_ch.h index f5ed1ea84b..72bfccf1e1 100644 --- a/libaf/reorder_ch.h +++ b/libaf/reorder_ch.h @@ -73,6 +73,8 @@ #define AF_CHANNEL_LAYOUT_LAVC_DCA_6CH_DEFAULT AF_CHANNEL_LAYOUT_5_1_D #define AF_CHANNEL_LAYOUT_VORBIS_5CH_DEFAULT AF_CHANNEL_LAYOUT_5_0_C #define AF_CHANNEL_LAYOUT_VORBIS_6CH_DEFAULT AF_CHANNEL_LAYOUT_5_1_C +#define AF_CHANNEL_LAYOUT_FLAC_5CH_DEFAULT AF_CHANNEL_LAYOUT_5_0_A +#define AF_CHANNEL_LAYOUT_FLAC_6CH_DEFAULT AF_CHANNEL_LAYOUT_5_1_A #define AF_CHANNEL_MASK 0xFF #define AF_GET_CH_NUM(A) ((A)&0x7F) @@ -105,7 +107,8 @@ void reorder_channel(void *buf, #define AF_CHANNEL_LAYOUT_LAVC_LIBA52_DEFAULT 4 #define AF_CHANNEL_LAYOUT_LAVC_DCA_DEFAULT 5 #define AF_CHANNEL_LAYOUT_VORBIS_DEFAULT 6 -#define AF_CHANNEL_LAYOUT_SOURCE_NUM 7 +#define AF_CHANNEL_LAYOUT_FLAC_DEFAULT 7 +#define AF_CHANNEL_LAYOUT_SOURCE_NUM 8 #define AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT AF_CHANNEL_LAYOUT_ALSA_DEFAULT /// Optimized channel reorder between different audio sources and targets. diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c index 64702f7825..c0a638db8c 100644 --- a/libmpcodecs/ad_ffmpeg.c +++ b/libmpcodecs/ad_ffmpeg.c @@ -177,6 +177,8 @@ static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int m src_ch_layout = AF_CHANNEL_LAYOUT_LAVC_LIBA52_DEFAULT; else if (!strcasecmp(codec, "vorbis")) src_ch_layout = AF_CHANNEL_LAYOUT_VORBIS_DEFAULT; + else if (!strcasecmp(codec, "flac")) + src_ch_layout = AF_CHANNEL_LAYOUT_FLAC_DEFAULT; else src_ch_layout = AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT; reorder_channel_nch(buf, src_ch_layout, |