diff options
author | Chris Robinson <[email protected]> | 2014-11-07 00:54:16 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-11-07 00:54:16 -0800 |
commit | 0051a9637644795c721945faf64f9917ec5aa788 (patch) | |
tree | d5eb47396290ee0f51513e9c01574ffc7cd5cd88 /Alc/backends/dsound.c | |
parent | 7a98e92117200ef1071dbf4ef2982141fe84e788 (diff) |
Fix 5.1 surround sound
Apparently, 5.1 surround sound is supposed to use the "side" channels, not the
back channels, and we've been wrong this whole time. That means the "5.1 Side"
is actually the correct 5.1 setup, and using the back channels is anomalous.
Additionally, this means the 5.1 buffer format should also use the the side
channels instead of the back channels.
A final note: the 5.1 mixing coefficients are changed so both use the original
5.1 surround sound set (with the surround channels at +/-110 degrees). So the
only difference now between 5.1 "side" and 5.1 "back" is the channel labels.
Diffstat (limited to 'Alc/backends/dsound.c')
-rw-r--r-- | Alc/backends/dsound.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/Alc/backends/dsound.c b/Alc/backends/dsound.c index 14f1a1c0..378c0798 100644 --- a/Alc/backends/dsound.c +++ b/Alc/backends/dsound.c @@ -43,6 +43,9 @@ #ifndef DSSPEAKER_5POINT1 # define DSSPEAKER_5POINT1 0x00000006 #endif +#ifndef DSSPEAKER_5POINT1_BACK +# define DSSPEAKER_5POINT1_BACK 0x00000006 +#endif #ifndef DSSPEAKER_7POINT1 # define DSSPEAKER_7POINT1 0x00000007 #endif @@ -450,8 +453,10 @@ static ALCboolean ALCdsoundPlayback_reset(ALCdsoundPlayback *self) device->FmtChans = DevFmtStereo; else if(speakers == DSSPEAKER_QUAD) device->FmtChans = DevFmtQuad; - else if(speakers == DSSPEAKER_5POINT1 || speakers == DSSPEAKER_5POINT1_SURROUND) + else if(speakers == DSSPEAKER_5POINT1_SURROUND) device->FmtChans = DevFmtX51; + else if(speakers == DSSPEAKER_5POINT1_BACK) + device->FmtChans = DevFmtX51Rear; else if(speakers == DSSPEAKER_7POINT1 || speakers == DSSPEAKER_7POINT1_SURROUND) device->FmtChans = DevFmtX71; else @@ -478,16 +483,16 @@ static ALCboolean ALCdsoundPlayback_reset(ALCdsoundPlayback *self) SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | - SPEAKER_BACK_LEFT | - SPEAKER_BACK_RIGHT; + SPEAKER_SIDE_LEFT | + SPEAKER_SIDE_RIGHT; break; - case DevFmtX51Side: + case DevFmtX51Rear: OutputType.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | - SPEAKER_SIDE_LEFT | - SPEAKER_SIDE_RIGHT; + SPEAKER_BACK_LEFT | + SPEAKER_BACK_RIGHT; break; case DevFmtX61: OutputType.dwChannelMask = SPEAKER_FRONT_LEFT | @@ -745,16 +750,16 @@ static ALCenum ALCdsoundCapture_open(ALCdsoundCapture *self, const ALCchar *devi SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | - SPEAKER_BACK_LEFT | - SPEAKER_BACK_RIGHT; + SPEAKER_SIDE_LEFT | + SPEAKER_SIDE_RIGHT; break; - case DevFmtX51Side: + case DevFmtX51Rear: InputType.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | - SPEAKER_SIDE_LEFT | - SPEAKER_SIDE_RIGHT; + SPEAKER_BACK_LEFT | + SPEAKER_BACK_RIGHT; break; case DevFmtX61: InputType.dwChannelMask = SPEAKER_FRONT_LEFT | |