changeset 29779:282ea4fbe87d

ad_ffmpeg: Fix channel layout for ffvorbis and ffaac Patch submitted by Nicolas George, nicolas.george normalesup org The layout exceptions removed by this patch were rendered unnecessary by changes in ffmpeg which normalize channel layout for aac (r20067) and vorbis (r20148).
author tack
date Wed, 04 Nov 2009 00:54:46 +0000
parents 88b76f9e4233
children 816c1f02ebfe
files libmpcodecs/ad_ffmpeg.c
diffstat 1 files changed, 1 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_ffmpeg.c	Tue Nov 03 23:54:32 2009 +0000
+++ b/libmpcodecs/ad_ffmpeg.c	Wed Nov 04 00:54:46 2009 +0000
@@ -177,17 +177,10 @@
 	if(y<x) sh_audio->ds->buffer_pos+=y-x;  // put back data (HACK!)
 	if(len2>0){
 	  if (((AVCodecContext *)sh_audio->context)->channels >= 5) {
-            int src_ch_layout = AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT;
             int samplesize = av_get_bits_per_sample_format(((AVCodecContext *)
                                     sh_audio->context)->sample_fmt) / 8;
             const char *codec=((AVCodecContext*)sh_audio->context)->codec->name;
-            if (!strcasecmp(codec, "aac"))
-              src_ch_layout = AF_CHANNEL_LAYOUT_LAVC_AAC_DEC_DEFAULT;
-            else if (!strcasecmp(codec, "vorbis"))
-              src_ch_layout = AF_CHANNEL_LAYOUT_VORBIS_DEFAULT;
-            else
-              src_ch_layout = AF_CHANNEL_LAYOUT_LAVC_DEFAULT;
-            reorder_channel_nch(buf, src_ch_layout,
+            reorder_channel_nch(buf, AF_CHANNEL_LAYOUT_LAVC_DEFAULT,
                                 AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT,
                                 ((AVCodecContext *)sh_audio->context)->channels,
                                 len2 / samplesize, samplesize);