diff options
author | Chris Robinson <[email protected]> | 2022-06-07 18:50:28 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-06-07 18:50:28 -0700 |
commit | 4750e553f1edb89f330be30953e88db65db577d9 (patch) | |
tree | b00cb1bd674e75b067d7d279daae2a433881075a /alc/backends/wasapi.cpp | |
parent | 86d1eb90edbf54789b82870bbd354220a222adff (diff) |
Track 5.1 Rear with WASAPI playback
Diffstat (limited to 'alc/backends/wasapi.cpp')
-rw-r--r-- | alc/backends/wasapi.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp index 913e83ea..9a51485a 100644 --- a/alc/backends/wasapi.cpp +++ b/alc/backends/wasapi.cpp @@ -875,6 +875,7 @@ HRESULT WasapiPlayback::resetProxy() const ReferenceTime per_time{ReferenceTime{seconds{mDevice->UpdateSize}} / mDevice->Frequency}; const ReferenceTime buf_time{ReferenceTime{seconds{mDevice->BufferSize}} / mDevice->Frequency}; + bool isRear51{false}; if(!mDevice->Flags.test(FrequencyRequest)) mDevice->Frequency = OutputType.Format.nSamplesPerSec; @@ -886,9 +887,13 @@ HRESULT WasapiPlayback::resetProxy() mDevice->FmtChans = DevFmtX71; else if(chancount >= 7 && (chanmask&X61Mask) == X6DOT1) mDevice->FmtChans = DevFmtX61; - else if(chancount >= 6 && ((chanmask&X51Mask) == X5DOT1 - || (chanmask&X51RearMask) == X5DOT1REAR)) + else if(chancount >= 6 && (chanmask&X51Mask) == X5DOT1) mDevice->FmtChans = DevFmtX51; + else if(chancount >= 6 && (chanmask&X51RearMask) == X5DOT1REAR) + { + mDevice->FmtChans = DevFmtX51; + isRear51 = true; + } else if(chancount >= 4 && (chanmask&QuadMask) == QUAD) mDevice->FmtChans = DevFmtQuad; else if(chancount >= 2 && (chanmask&StereoMask) == STEREO) @@ -898,6 +903,12 @@ HRESULT WasapiPlayback::resetProxy() else ERR("Unhandled channel config: %d -- 0x%08lx\n", chancount, chanmask); } + else + { + const uint32_t chancount{OutputType.Format.nChannels}; + const DWORD chanmask{OutputType.dwChannelMask}; + isRear51 = (chancount >= 6 && (chanmask&X51RearMask) == X5DOT1REAR); + } OutputType.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; switch(mDevice->FmtChans) @@ -919,7 +930,7 @@ HRESULT WasapiPlayback::resetProxy() break; case DevFmtX51: OutputType.Format.nChannels = 6; - OutputType.dwChannelMask = X5DOT1; + OutputType.dwChannelMask = isRear51 ? X5DOT1REAR : X5DOT1; break; case DevFmtX61: OutputType.Format.nChannels = 7; |