Mercurial > mplayer.hg
changeset 27700:e65738d7dd3b
Fix channel order for ffmpeg flac codec.
This patch comes from Andrew de Quincey <adq_dvb at lidskialf dot net>.
author | ulion |
---|---|
date | Thu, 09 Oct 2008 07:46:20 +0000 |
parents | 31a477d77c57 |
children | 5916162c1bd3 |
files | libaf/reorder_ch.c libaf/reorder_ch.h libmpcodecs/ad_ffmpeg.c |
diffstat | 3 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libaf/reorder_ch.c Wed Oct 08 17:48:23 2008 +0000 +++ b/libaf/reorder_ch.c Thu Oct 09 07:46:20 2008 +0000 @@ -1109,6 +1109,7 @@ 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 @@ 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,
--- a/libaf/reorder_ch.h Wed Oct 08 17:48:23 2008 +0000 +++ b/libaf/reorder_ch.h Thu Oct 09 07:46:20 2008 +0000 @@ -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 @@ #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.
--- a/libmpcodecs/ad_ffmpeg.c Wed Oct 08 17:48:23 2008 +0000 +++ b/libmpcodecs/ad_ffmpeg.c Thu Oct 09 07:46:20 2008 +0000 @@ -177,6 +177,8 @@ 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,