Skip to content

Commit

Permalink
[xaudio2] Fix capture backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas BOUQUET committed Mar 22, 2023
1 parent aa2bcb9 commit 03a2969
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions alc/backends/xaudio2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ uint XAudio2Capture::availableSamples()
{
if (!record) return 0;
mutex.lock();
size_t cur = std::max(mBufferSize - mSkip, (size_t)0) / mFrameSize;
size_t cur = ((mBufferSize>mSkip)?(mBufferSize - mSkip):(size_t)0) / mFrameSize;
size_t room = sizeof(mBuffer) - mBufferSize;
mutex.unlock();
if (room > 1024) {
Expand Down Expand Up @@ -305,7 +305,7 @@ void XAudio2Capture::failed()
void XAudio2Capture::open(const char* name)
{
DevFmtType devtype = DevFmtShort;
mFrameSize = BytesFromDevFmt(devtype) * 2;
mFrameSize = BytesFromDevFmt(devtype); //Mono ?
mDevice->DeviceName = name ? name : defaultDeviceName;
}

Expand Down

0 comments on commit 03a2969

Please sign in to comment.