From 4d1ac95ae2ef1ca3a20205b4cc9893b02f0c7c22 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 17 Dec 2020 03:06:52 -0800 Subject: Don't return an enum from captureSamples It's always no_error --- alc/backends/dsound.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'alc/backends/dsound.cpp') diff --git a/alc/backends/dsound.cpp b/alc/backends/dsound.cpp index 061e9a18..71ad0611 100644 --- a/alc/backends/dsound.cpp +++ b/alc/backends/dsound.cpp @@ -564,8 +564,8 @@ struct DSoundCapture final : public BackendBase { void open(const ALCchar *name) override; void start() override; void stop() override; - ALCenum captureSamples(al::byte *buffer, ALCuint samples) override; - ALCuint availableSamples() override; + void captureSamples(al::byte *buffer, uint samples) override; + uint availableSamples() override; IDirectSoundCapture *mDSC{nullptr}; IDirectSoundCaptureBuffer *mDSCbuffer{nullptr}; @@ -735,18 +735,15 @@ void DSoundCapture::stop() } } -ALCenum DSoundCapture::captureSamples(al::byte *buffer, ALCuint samples) -{ - mRing->read(buffer, samples); - return ALC_NO_ERROR; -} +void DSoundCapture::captureSamples(al::byte *buffer, uint samples) +{ mRing->read(buffer, samples); } -ALCuint DSoundCapture::availableSamples() +uint DSoundCapture::availableSamples() { if(!mDevice->Connected.load(std::memory_order_acquire)) - return static_cast(mRing->readSpace()); + return static_cast(mRing->readSpace()); - const ALuint FrameSize{mDevice->frameSizeFromFmt()}; + const uint FrameSize{mDevice->frameSizeFromFmt()}; const DWORD BufferBytes{mBufferBytes}; const DWORD LastCursor{mCursor}; @@ -757,7 +754,7 @@ ALCuint DSoundCapture::availableSamples() if(SUCCEEDED(hr)) { const DWORD NumBytes{(BufferBytes+ReadCursor-LastCursor) % BufferBytes}; - if(!NumBytes) return static_cast(mRing->readSpace()); + if(!NumBytes) return static_cast(mRing->readSpace()); hr = mDSCbuffer->Lock(LastCursor, NumBytes, &ReadPtr1, &ReadCnt1, &ReadPtr2, &ReadCnt2, 0); } if(SUCCEEDED(hr)) @@ -775,7 +772,7 @@ ALCuint DSoundCapture::availableSamples() mDevice->handleDisconnect("Failure retrieving capture data: 0x%lx", hr); } - return static_cast(mRing->readSpace()); + return static_cast(mRing->readSpace()); } } // namespace -- cgit v1.2.3