From 29fba79cd5dd06888da22c7fc18779062c28fc3a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 30 Jul 2021 07:38:26 -0700 Subject: Avoid 5.1Rear as its own channel configuration It messes with 5.1 sources using direct channels, and the surround channels are supposed to map to the side labels. Individual backends can deal with the channel order/label differences, as they already do to a degree. --- alc/backends/wasapi.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'alc/backends/wasapi.cpp') diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp index d38fc25d..e726e8f1 100644 --- a/alc/backends/wasapi.cpp +++ b/alc/backends/wasapi.cpp @@ -876,10 +876,9 @@ HRESULT WasapiPlayback::resetProxy() mDevice->FmtChans = DevFmtX71; else if(chancount >= 7 && (chanmask&X61Mask) == X6DOT1) mDevice->FmtChans = DevFmtX61; - else if(chancount >= 6 && (chanmask&X51Mask) == X5DOT1) + else if(chancount >= 6 && ((chanmask&X51Mask) == X5DOT1 + || (chanmask&X51RearMask) == X5DOT1REAR)) mDevice->FmtChans = DevFmtX51; - else if(chancount >= 6 && (chanmask&X51RearMask) == X5DOT1REAR) - mDevice->FmtChans = DevFmtX51Rear; else if(chancount >= 4 && (chanmask&QuadMask) == QUAD) mDevice->FmtChans = DevFmtQuad; else if(chancount >= 2 && (chanmask&StereoMask) == STEREO) @@ -912,10 +911,6 @@ HRESULT WasapiPlayback::resetProxy() OutputType.Format.nChannels = 6; OutputType.dwChannelMask = X5DOT1; break; - case DevFmtX51Rear: - OutputType.Format.nChannels = 6; - OutputType.dwChannelMask = X5DOT1REAR; - break; case DevFmtX61: OutputType.Format.nChannels = 7; OutputType.dwChannelMask = X6DOT1; @@ -995,10 +990,9 @@ HRESULT WasapiPlayback::resetProxy() mDevice->FmtChans = DevFmtX71; else if(chancount >= 7 && (chanmask&X61Mask) == X6DOT1) mDevice->FmtChans = DevFmtX61; - else if(chancount >= 6 && (chanmask&X51Mask) == X5DOT1) + else if(chancount >= 6 && ((chanmask&X51Mask) == X5DOT1 + || (chanmask&X51RearMask) == X5DOT1REAR)) mDevice->FmtChans = DevFmtX51; - else if(chancount >= 6 && (chanmask&X51RearMask) == X5DOT1REAR) - mDevice->FmtChans = DevFmtX51Rear; else if(chancount >= 4 && (chanmask&QuadMask) == QUAD) mDevice->FmtChans = DevFmtQuad; else if(chancount >= 2 && (chanmask&StereoMask) == STEREO) @@ -1421,10 +1415,6 @@ HRESULT WasapiCapture::resetProxy() InputType.Format.nChannels = 6; InputType.dwChannelMask = X5DOT1; break; - case DevFmtX51Rear: - InputType.Format.nChannels = 6; - InputType.dwChannelMask = X5DOT1REAR; - break; case DevFmtX61: InputType.Format.nChannels = 7; InputType.dwChannelMask = X6DOT1; @@ -1509,7 +1499,6 @@ HRESULT WasapiCapture::resetProxy() return (chancount == 4 && (chanmask == 0 || (chanmask&QuadMask) == QUAD)); /* 5.1 (Side) and 5.1 (Rear) are interchangeable here. */ case DevFmtX51: - case DevFmtX51Rear: return (chancount == 6 && (chanmask == 0 || (chanmask&X51Mask) == X5DOT1 || (chanmask&X51RearMask) == X5DOT1REAR)); case DevFmtX61: -- cgit v1.2.3