[xiph-commits] r16816 - trunk/vorbis-tools/ogg123

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Mon Jan 25 23:33:24 PST 2010


Author: xiphmont
Date: 2010-01-25 23:33:24 -0800 (Mon, 25 Jan 2010)
New Revision: 16816

Modified:
   trunk/vorbis-tools/ogg123/flac_format.c
Log:
Add proper channel mapping to flac decode



Modified: trunk/vorbis-tools/ogg123/flac_format.c
===================================================================
--- trunk/vorbis-tools/ogg123/flac_format.c	2010-01-26 07:20:43 UTC (rev 16815)
+++ trunk/vorbis-tools/ogg123/flac_format.c	2010-01-26 07:33:24 UTC (rev 16816)
@@ -264,6 +264,36 @@
     decoder->actual_fmt.channels = priv->channels;
     decoder->actual_fmt.word_size = ((priv->bits_per_sample + 7) / 8);
 
+    switch(decoder->actual_fmt.channels){
+    case 1:
+      decoder->actual_fmt.matrix="M";
+      break;
+    case 2:
+      decoder->actual_fmt.matrix="L,R";
+      break;
+    case 3:
+      decoder->actual_fmt.matrix="L,R,C";
+      break;
+    case 4:
+      decoder->actual_fmt.matrix="L,R,BL,BR";
+      break;
+    case 5:
+      decoder->actual_fmt.matrix="L,R,C,BL,BR";
+      break;
+    case 6:
+      decoder->actual_fmt.matrix="L,R,C,LFE,BL,BR";
+      break;
+    case 7:
+      decoder->actual_fmt.matrix="L,R,C,LFE,SL,SR,BC";
+      break;
+    case 8:
+      decoder->actual_fmt.matrix="L,R,C,LFE,SL,SR,BL,BR";
+      break;
+    default:
+      decoder->actual_fmt.matrix=NULL;
+      break;
+    }
+
     print_flac_stream_info(decoder);
     if (priv->comments != NULL) 
       print_flac_comments(&priv->comments->data.vorbis_comment, cb,



More information about the commits mailing list