[Mplayer-cvslog] CVS: main dec_audio.c,1.47,1.48

Alex Beregszaszi alex at mplayer.dev.hu
Tue Oct 23 19:26:23 CEST 2001


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv9347

Modified Files:
	dec_audio.c 
Log Message:
audio channels nr is identified from libmad's channel mode

Index: dec_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_audio.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- dec_audio.c	23 Oct 2001 17:01:55 -0000	1.47
+++ dec_audio.c	23 Oct 2001 17:26:20 -0000	1.48
@@ -588,7 +588,21 @@
 	 printf(__FILE__ ":%d:mad: frame decoding failed\n", __LINE__);
        }
      
-     sh_audio->channels=2; // hack
+     switch (mad_frame.header.mode)
+     {
+        case MAD_MODE_SINGLE_CHANNEL:
+	    sh_audio->channels=1;
+	    break;
+	case MAD_MODE_DUAL_CHANNEL:
+	case MAD_MODE_JOINT_STEREO:
+	case MAD_MODE_STEREO:
+	    sh_audio->channels=2;
+	    break;
+	default:
+	    mp_msg(MSGT_DECAUDIO, MSGL_FATAL, "mad: unknown number of channels\n");
+     }
+     mp_msg(MSGT_DECAUDIO, MSGL_HINT, "mad: channels: %d (mad channel mode: %d)\n",
+        sh_audio->channels, mad_frame.header.mode);
 /* var. name changed in 0.13.0 (beta) (libmad/CHANGES) -- alex */
 #if (MAD_VERSION_MAJOR >= 0) && (MAD_VERSION_MINOR >= 13)
      sh_audio->samplerate=mad_frame.header.samplerate;




More information about the MPlayer-cvslog mailing list