[xiph-commits] r15560 - trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource
cristianadam at svn.xiph.org
cristianadam at svn.xiph.org
Sat Dec 6 04:00:08 PST 2008
Author: cristianadam
Date: 2008-12-06 04:00:07 -0800 (Sat, 06 Dec 2008)
New Revision: 15560
Modified:
trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.cpp
Log:
Fixed Ticket #1471 (speaker vibrations with oggcodecs v.0.80.15039)
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.cpp 2008-12-05 23:18:50 UTC (rev 15559)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.cpp 2008-12-06 12:00:07 UTC (rev 15560)
@@ -139,15 +139,50 @@
locFormatEx->Samples.wValidBitsPerSample = (WORD)mParentFilter->mSignificantBitsPerSample;
- //TODO::: Map this properly! What is the correct mapping ???
- locFormatEx->dwChannelMask = SPEAKER_FRONT_LEFT
- | SPEAKER_FRONT_RIGHT
- | SPEAKER_FRONT_CENTER
- | SPEAKER_LOW_FREQUENCY
- | SPEAKER_BACK_LEFT
- | SPEAKER_BACK_RIGHT
- ;
+ switch (locFormatEx->Format.nChannels)
+ {
+ case 1:
+ locFormatEx->dwChannelMask = SPEAKER_FRONT_LEFT;
+ break;
+ case 2:
+ locFormatEx->dwChannelMask = SPEAKER_FRONT_LEFT |
+ SPEAKER_FRONT_RIGHT;
+ break;
+ case 3:
+ locFormatEx->dwChannelMask = SPEAKER_FRONT_LEFT |
+ SPEAKER_FRONT_RIGHT |
+ SPEAKER_FRONT_CENTER;
+ break;
+ case 4:
+ locFormatEx->dwChannelMask = SPEAKER_FRONT_LEFT |
+ SPEAKER_FRONT_RIGHT |
+ SPEAKER_BACK_LEFT |
+ SPEAKER_BACK_RIGHT;
+ break;
+ case 5:
+ locFormatEx->dwChannelMask = SPEAKER_FRONT_LEFT |
+ SPEAKER_FRONT_RIGHT |
+ SPEAKER_FRONT_CENTER |
+ SPEAKER_BACK_LEFT |
+ SPEAKER_BACK_RIGHT;
+ break;
+ case 6:
+ locFormatEx->dwChannelMask = SPEAKER_FRONT_LEFT |
+ SPEAKER_FRONT_RIGHT |
+ SPEAKER_FRONT_CENTER |
+ SPEAKER_LOW_FREQUENCY |
+ SPEAKER_BACK_LEFT |
+ SPEAKER_BACK_RIGHT;
+ break;
+
+ default:
+ locFormatEx->dwChannelMask = 0;
+ break;
+
+
+ }
+
////TODO::: Round up to multiple of 8 or something
//if (mParentFilter->mBitsPerSample <= 16) {
// //Round up to multiple of 8, ie 8 or 16
More information about the commits
mailing list