diff options
author | Chris Robinson <[email protected]> | 2022-11-13 14:37:25 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-11-13 14:37:25 -0800 |
commit | df6761d4244c89fefec2a500c1bd4dd339a3ac0b (patch) | |
tree | b88fdf7346c82301dcc7595ebd1de68fa0ad8359 | |
parent | 543660f1a7c03634c6bec184a47dfd7c9845f17f (diff) |
Use the correct frame size for WASAPI resampling
-rw-r--r-- | alc/backends/wasapi.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp index 504313b4..1ce064e8 100644 --- a/alc/backends/wasapi.cpp +++ b/alc/backends/wasapi.cpp @@ -698,7 +698,7 @@ FORCE_ALIGN int WasapiPlayback::mixerProc() SetRTPriority(); althrd_setname(MIXER_THREAD_NAME); - const uint frame_size{mDevice->frameSizeFromFmt()}; + const uint frame_size{mFormat.Format.nChannels * mFormat.Format.wBitsPerSample / 8u}; const uint update_size{mOrigUpdateSize}; const UINT32 buffer_len{mOrigBufferSize}; while(!mKillNow.load(std::memory_order_relaxed)) @@ -1204,7 +1204,7 @@ HRESULT WasapiPlayback::resetProxy() mFormat.Format.nChannels, mDevice->Frequency, mFormat.Format.nSamplesPerSec, Resampler::FastBSinc24); mResampleBuffer = std::make_unique<char[]>(size_t{mDevice->UpdateSize} * - mDevice->frameSizeFromFmt()); + mFormat.Format.nChannels * mFormat.Format.wBitsPerSample / 8); TRACE("Created converter for %s/%s format, dst: %luhz (%u), src: %uhz (%u)\n", DevFmtChannelsString(mDevice->FmtChans), DevFmtTypeString(mDevice->FmtType), |