[xiph-commits] r11397 - trunk/xiph-qt/OggImport/src
arek at svn.xiph.org
arek at svn.xiph.org
Wed May 10 06:51:53 PDT 2006
Author: arek
Date: 2006-05-10 06:51:49 -0700 (Wed, 10 May 2006)
New Revision: 11397
Modified:
trunk/xiph-qt/OggImport/src/stream_vorbis.c
Log:
Added support for all channel layout mappings defined in the Vorbis spec.
Modified: trunk/xiph-qt/OggImport/src/stream_vorbis.c
===================================================================
--- trunk/xiph-qt/OggImport/src/stream_vorbis.c 2006-05-10 13:49:44 UTC (rev 11396)
+++ trunk/xiph-qt/OggImport/src/stream_vorbis.c 2006-05-10 13:51:49 UTC (rev 11397)
@@ -114,16 +114,33 @@
asbd.mBitsPerChannel = 0;
asbd.mReserved = 0;
- if (si->numChannels == 1)
+ acl.mChannelBitmap = 0;
+ acl.mNumberChannelDescriptions = 0;
+ switch (si->numChannels) {
+ case 1:
acl.mChannelLayoutTag = kAudioChannelLayoutTag_Mono;
- else if (si->numChannels == 2)
+ break;
+ case 2:
acl.mChannelLayoutTag = kAudioChannelLayoutTag_Stereo;
- else {
+ break;
+ case 3:
+ //TODO: this should be done using channel descriptions probably...
+ acl.mChannelLayoutTag = kAudioChannelLayoutTag_UseChannelBitmap;
+ acl.mChannelBitmap = kAudioChannelBit_Left | kAudioChannelBit_Right | kAudioChannelBit_CenterSurround;
+ break;
+ case 4:
+ acl.mChannelLayoutTag = kAudioChannelLayoutTag_Quadraphonic;
+ break;
+ case 5:
+ acl.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_5_0_C;
+ break;
+ case 6:
+ acl.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_5_1_C;
+ break;
+ default:
pacl = NULL;
acl_size = 0;
}
- acl.mChannelBitmap = 0;
- acl.mNumberChannelDescriptions = 0;
err = QTSoundDescriptionCreate(&asbd, pacl, acl_size, NULL, 0, kQTSoundDescriptionKind_Movie_Version2, (SoundDescriptionHandle*) &desc);
More information about the commits
mailing list