diff options
Diffstat (limited to 'alc/backends')
-rw-r--r-- | alc/backends/alsa.cpp | 16 | ||||
-rw-r--r-- | alc/backends/coreaudio.cpp | 2 | ||||
-rw-r--r-- | alc/backends/dsound.cpp | 14 | ||||
-rw-r--r-- | alc/backends/jack.cpp | 4 | ||||
-rw-r--r-- | alc/backends/null.cpp | 6 | ||||
-rw-r--r-- | alc/backends/oboe.cpp | 2 | ||||
-rw-r--r-- | alc/backends/opensl.cpp | 19 | ||||
-rw-r--r-- | alc/backends/oss.cpp | 12 | ||||
-rw-r--r-- | alc/backends/portaudio.cpp | 2 | ||||
-rw-r--r-- | alc/backends/pulseaudio.cpp | 12 | ||||
-rw-r--r-- | alc/backends/sdl2.cpp | 2 | ||||
-rw-r--r-- | alc/backends/sndio.cpp | 8 | ||||
-rw-r--r-- | alc/backends/solaris.cpp | 10 | ||||
-rw-r--r-- | alc/backends/wasapi.cpp | 12 | ||||
-rw-r--r-- | alc/backends/wave.cpp | 6 | ||||
-rw-r--r-- | alc/backends/winmm.cpp | 2 |
16 files changed, 62 insertions, 67 deletions
diff --git a/alc/backends/alsa.cpp b/alc/backends/alsa.cpp index 2259c46c..20ed0e78 100644 --- a/alc/backends/alsa.cpp +++ b/alc/backends/alsa.cpp @@ -457,7 +457,7 @@ int AlsaPlayback::mixerProc() if(state < 0) { ERR("Invalid state detected: %s\n", snd_strerror(state)); - aluHandleDisconnect(mDevice, "Bad state: %s", snd_strerror(state)); + mDevice->handleDisconnect("Bad state: %s", snd_strerror(state)); break; } @@ -510,10 +510,10 @@ int AlsaPlayback::mixerProc() } char *WritePtr{static_cast<char*>(areas->addr) + (offset * areas->step / 8)}; - aluMixData(mDevice, WritePtr, static_cast<ALuint>(frames), areas->step / samplebits); + mDevice->renderSamples(WritePtr, static_cast<ALuint>(frames), areas->step/samplebits); snd_pcm_sframes_t commitres{snd_pcm_mmap_commit(mPcmHandle, offset, frames)}; - if(commitres < 0 || (static_cast<snd_pcm_uframes_t>(commitres)-frames) != 0) + if(commitres < 0 || static_cast<snd_pcm_uframes_t>(commitres) != frames) { ERR("mmap commit error: %s\n", snd_strerror(commitres >= 0 ? -EPIPE : static_cast<int>(commitres))); @@ -541,7 +541,7 @@ int AlsaPlayback::mixerNoMMapProc() if(state < 0) { ERR("Invalid state detected: %s\n", snd_strerror(state)); - aluHandleDisconnect(mDevice, "Bad state: %s", snd_strerror(state)); + mDevice->handleDisconnect("Bad state: %s", snd_strerror(state)); break; } @@ -578,7 +578,7 @@ int AlsaPlayback::mixerNoMMapProc() al::byte *WritePtr{mBuffer.data()}; avail = snd_pcm_bytes_to_frames(mPcmHandle, static_cast<ssize_t>(mBuffer.size())); std::lock_guard<std::mutex> _{mMutex}; - aluMixData(mDevice, WritePtr, static_cast<ALuint>(avail), frame_step); + mDevice->renderSamples(WritePtr, static_cast<ALuint>(avail), frame_step); while(avail > 0) { snd_pcm_sframes_t ret{snd_pcm_writei(mPcmHandle, WritePtr, @@ -1071,7 +1071,7 @@ ALCenum AlsaCapture::captureSamples(al::byte *buffer, ALCuint samples) { const char *err{snd_strerror(static_cast<int>(amt))}; ERR("restore error: %s\n", err); - aluHandleDisconnect(mDevice, "Capture recovery failure: %s", err); + mDevice->handleDisconnect("Capture recovery failure: %s", err); break; } /* If the amount available is less than what's asked, we lost it @@ -1111,7 +1111,7 @@ ALCuint AlsaCapture::availableSamples() { const char *err{snd_strerror(static_cast<int>(avail))}; ERR("restore error: %s\n", err); - aluHandleDisconnect(mDevice, "Capture recovery failure: %s", err); + mDevice->handleDisconnect("Capture recovery failure: %s", err); } } @@ -1147,7 +1147,7 @@ ALCuint AlsaCapture::availableSamples() { const char *err{snd_strerror(static_cast<int>(amt))}; ERR("restore error: %s\n", err); - aluHandleDisconnect(mDevice, "Capture recovery failure: %s", err); + mDevice->handleDisconnect("Capture recovery failure: %s", err); break; } avail = amt; diff --git a/alc/backends/coreaudio.cpp b/alc/backends/coreaudio.cpp index 2884bad6..25fb71ab 100644 --- a/alc/backends/coreaudio.cpp +++ b/alc/backends/coreaudio.cpp @@ -82,7 +82,7 @@ CoreAudioPlayback::~CoreAudioPlayback() OSStatus CoreAudioPlayback::MixerProc(AudioUnitRenderActionFlags*, const AudioTimeStamp*, UInt32, UInt32, AudioBufferList *ioData) noexcept { - aluMixData(mDevice, ioData->mBuffers[0].mData, ioData->mBuffers[0].mDataByteSize/mFrameSize, + mDevice->renderSamples(ioData->mBuffers[0].mData, ioData->mBuffers[0].mDataByteSize/mFrameSize, ioData->mBuffers[0].mNumberChannels); return noErr; } diff --git a/alc/backends/dsound.cpp b/alc/backends/dsound.cpp index e86153aa..c1921430 100644 --- a/alc/backends/dsound.cpp +++ b/alc/backends/dsound.cpp @@ -224,7 +224,7 @@ FORCE_ALIGN int DSoundPlayback::mixerProc() if(FAILED(err)) { ERR("Failed to get buffer caps: 0x%lx\n", err); - aluHandleDisconnect(mDevice, "Failure retrieving playback buffer info: 0x%lx", err); + mDevice->handleDisconnect("Failure retrieving playback buffer info: 0x%lx", err); return 1; } @@ -251,7 +251,7 @@ FORCE_ALIGN int DSoundPlayback::mixerProc() if(FAILED(err)) { ERR("Failed to play buffer: 0x%lx\n", err); - aluHandleDisconnect(mDevice, "Failure starting playback: 0x%lx", err); + mDevice->handleDisconnect("Failure starting playback: 0x%lx", err); return 1; } Playing = true; @@ -285,16 +285,16 @@ FORCE_ALIGN int DSoundPlayback::mixerProc() if(SUCCEEDED(err)) { - aluMixData(mDevice, WritePtr1, WriteCnt1/FrameSize, FrameStep); + mDevice->renderSamples(WritePtr1, WriteCnt1/FrameSize, FrameStep); if(WriteCnt2 > 0) - aluMixData(mDevice, WritePtr2, WriteCnt2/FrameSize, FrameStep); + mDevice->renderSamples(WritePtr2, WriteCnt2/FrameSize, FrameStep); mBuffer->Unlock(WritePtr1, WriteCnt1, WritePtr2, WriteCnt2); } else { ERR("Buffer lock error: %#lx\n", err); - aluHandleDisconnect(mDevice, "Failed to lock output buffer: 0x%lx", err); + mDevice->handleDisconnect("Failed to lock output buffer: 0x%lx", err); return 1; } @@ -717,7 +717,7 @@ void DSoundCapture::stop() if(FAILED(hr)) { ERR("stop failed: 0x%08lx\n", hr); - aluHandleDisconnect(mDevice, "Failure stopping capture: 0x%lx", hr); + mDevice->handleDisconnect("Failure stopping capture: 0x%lx", hr); } } @@ -758,7 +758,7 @@ ALCuint DSoundCapture::availableSamples() if(FAILED(hr)) { ERR("update failed: 0x%08lx\n", hr); - aluHandleDisconnect(mDevice, "Failure retrieving capture data: 0x%lx", hr); + mDevice->handleDisconnect("Failure retrieving capture data: 0x%lx", hr); } return static_cast<ALCuint>(mRing->readSpace()); diff --git a/alc/backends/jack.cpp b/alc/backends/jack.cpp index 6f53b54c..fe3aa794 100644 --- a/alc/backends/jack.cpp +++ b/alc/backends/jack.cpp @@ -287,9 +287,9 @@ int JackPlayback::mixerProc() ALuint len2{minu(static_cast<ALuint>(data.second.len), todo-len1)}; std::lock_guard<std::mutex> _{mMutex}; - aluMixData(mDevice, data.first.buf, len1, frame_step); + mDevice->renderSamples(data.first.buf, len1, frame_step); if(len2 > 0) - aluMixData(mDevice, data.second.buf, len2, frame_step); + mDevice->renderSamples(data.second.buf, len2, frame_step); mRing->writeAdvance(todo); } diff --git a/alc/backends/null.cpp b/alc/backends/null.cpp index 6e47f153..f78a23a0 100644 --- a/alc/backends/null.cpp +++ b/alc/backends/null.cpp @@ -72,8 +72,8 @@ int NullBackend::mixerProc() int64_t done{0}; auto start = std::chrono::steady_clock::now(); - while(!mKillNow.load(std::memory_order_acquire) && - mDevice->Connected.load(std::memory_order_acquire)) + while(!mKillNow.load(std::memory_order_acquire) + && mDevice->Connected.load(std::memory_order_acquire)) { auto now = std::chrono::steady_clock::now(); @@ -86,7 +86,7 @@ int NullBackend::mixerProc() } while(avail-done >= mDevice->UpdateSize) { - aluMixData(mDevice, nullptr, mDevice->UpdateSize, 0u); + mDevice->renderSamples(nullptr, mDevice->UpdateSize, 0u); done += mDevice->UpdateSize; } diff --git a/alc/backends/oboe.cpp b/alc/backends/oboe.cpp index 4a8188f3..f4a9877a 100644 --- a/alc/backends/oboe.cpp +++ b/alc/backends/oboe.cpp @@ -49,7 +49,7 @@ oboe::DataCallbackResult OboePlayback::onAudioReady(oboe::AudioStream *oboeStrea memset(audioData, 0, static_cast<uint32_t>(numFrames*numChannels)*sizeof(int16_t)); } - aluMixData(mDevice, audioData, static_cast<uint32_t>(numFrames), + mDevice->renderSamples(audioData, static_cast<uint32_t>(numFrames), static_cast<uint32_t>(numChannels)); return oboe::DataCallbackResult::Continue; } diff --git a/alc/backends/opensl.cpp b/alc/backends/opensl.cpp index 8c235cd2..8ac11e94 100644 --- a/alc/backends/opensl.cpp +++ b/alc/backends/opensl.cpp @@ -234,10 +234,10 @@ int OpenSLPlayback::mixerProc() const size_t frame_step{mDevice->channelsFromFmt()}; if(SL_RESULT_SUCCESS != result) - aluHandleDisconnect(mDevice, "Failed to get playback buffer: 0x%08x", result); + mDevice->handleDisconnect("Failed to get playback buffer: 0x%08x", result); - while(SL_RESULT_SUCCESS == result && !mKillNow.load(std::memory_order_acquire) && - mDevice->Connected.load(std::memory_order_acquire)) + while(SL_RESULT_SUCCESS == result && !mKillNow.load(std::memory_order_acquire) + && mDevice->Connected.load(std::memory_order_acquire)) { if(mRing->writeSpace() == 0) { @@ -252,7 +252,7 @@ int OpenSLPlayback::mixerProc() } if(SL_RESULT_SUCCESS != result) { - aluHandleDisconnect(mDevice, "Failed to start platback: 0x%08x", result); + mDevice->handleDisconnect("Failed to start platback: 0x%08x", result); break; } @@ -265,10 +265,10 @@ int OpenSLPlayback::mixerProc() std::unique_lock<std::mutex> dlock{mMutex}; auto data = mRing->getWriteVector(); - aluMixData(mDevice, data.first.buf, + mDevice->renderSamples(data.first.buf, static_cast<ALuint>(data.first.len*mDevice->UpdateSize), frame_step); if(data.second.len > 0) - aluMixData(mDevice, data.second.buf, + mDevice->renderSamples(data.second.buf, static_cast<ALuint>(data.second.len*mDevice->UpdateSize), frame_step); size_t todo{data.first.len + data.second.len}; @@ -288,7 +288,7 @@ int OpenSLPlayback::mixerProc() PRINTERR(result, "bufferQueue->Enqueue"); if(SL_RESULT_SUCCESS != result) { - aluHandleDisconnect(mDevice, "Failed to queue audio: 0x%08x", result); + mDevice->handleDisconnect("Failed to queue audio: 0x%08x", result); break; } @@ -874,7 +874,7 @@ ALCenum OpenSLCapture::captureSamples(al::byte *buffer, ALCuint samples) PRINTERR(result, "recordObj->GetInterface"); if UNLIKELY(SL_RESULT_SUCCESS != result) { - aluHandleDisconnect(mDevice, "Failed to get capture buffer queue: 0x%08x", result); + mDevice->handleDisconnect("Failed to get capture buffer queue: 0x%08x", result); bufferQueue = nullptr; } } @@ -904,8 +904,7 @@ ALCenum OpenSLCapture::captureSamples(al::byte *buffer, ALCuint samples) PRINTERR(result, "bufferQueue->Enqueue"); if UNLIKELY(SL_RESULT_SUCCESS != result) { - aluHandleDisconnect(mDevice, "Failed to update capture buffer: 0x%08x", - result); + mDevice->handleDisconnect("Failed to update capture buffer: 0x%08x", result); bufferQueue = nullptr; } } diff --git a/alc/backends/oss.cpp b/alc/backends/oss.cpp index 1fe3c475..0f00115e 100644 --- a/alc/backends/oss.cpp +++ b/alc/backends/oss.cpp @@ -277,7 +277,7 @@ int OSSPlayback::mixerProc() if(errno == EINTR || errno == EAGAIN) continue; ERR("poll failed: %s\n", strerror(errno)); - aluHandleDisconnect(mDevice, "Failed waiting for playback buffer: %s", strerror(errno)); + mDevice->handleDisconnect("Failed waiting for playback buffer: %s", strerror(errno)); break; } else if(pret == 0) @@ -288,7 +288,7 @@ int OSSPlayback::mixerProc() ALubyte *write_ptr{mMixData.data()}; size_t to_write{mMixData.size()}; - aluMixData(mDevice, write_ptr, static_cast<ALuint>(to_write/frame_size), frame_step); + mDevice->renderSamples(write_ptr, static_cast<ALuint>(to_write/frame_size), frame_step); while(to_write > 0 && !mKillNow.load(std::memory_order_acquire)) { ssize_t wrote{write(mFd, write_ptr, to_write)}; @@ -297,8 +297,7 @@ int OSSPlayback::mixerProc() if(errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) continue; ERR("write failed: %s\n", strerror(errno)); - aluHandleDisconnect(mDevice, "Failed writing playback samples: %s", - strerror(errno)); + mDevice->handleDisconnect("Failed writing playback samples: %s", strerror(errno)); break; } @@ -487,7 +486,7 @@ int OSScapture::recordProc() if(errno == EINTR || errno == EAGAIN) continue; ERR("poll failed: %s\n", strerror(errno)); - aluHandleDisconnect(mDevice, "Failed to check capture samples: %s", strerror(errno)); + mDevice->handleDisconnect("Failed to check capture samples: %s", strerror(errno)); break; } else if(sret == 0) @@ -503,8 +502,7 @@ int OSScapture::recordProc() if(amt < 0) { ERR("read failed: %s\n", strerror(errno)); - aluHandleDisconnect(mDevice, "Failed reading capture samples: %s", - strerror(errno)); + mDevice->handleDisconnect("Failed reading capture samples: %s", strerror(errno)); break; } mRing->writeAdvance(static_cast<ALuint>(amt)/frame_size); diff --git a/alc/backends/portaudio.cpp b/alc/backends/portaudio.cpp index 5bb792c3..42dbb4c9 100644 --- a/alc/backends/portaudio.cpp +++ b/alc/backends/portaudio.cpp @@ -110,7 +110,7 @@ PortPlayback::~PortPlayback() int PortPlayback::writeCallback(const void*, void *outputBuffer, unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo*, const PaStreamCallbackFlags) noexcept { - aluMixData(mDevice, outputBuffer, static_cast<ALuint>(framesPerBuffer), + mDevice->renderSamples(outputBuffer, static_cast<ALuint>(framesPerBuffer), static_cast<ALuint>(mParams.channelCount)); return 0; } diff --git a/alc/backends/pulseaudio.cpp b/alc/backends/pulseaudio.cpp index 6b8b4a6a..5bcd8b5f 100644 --- a/alc/backends/pulseaudio.cpp +++ b/alc/backends/pulseaudio.cpp @@ -766,7 +766,7 @@ void PulsePlayback::streamStateCallback(pa_stream *stream) noexcept if(pa_stream_get_state(stream) == PA_STREAM_FAILED) { ERR("Received stream failure!\n"); - aluHandleDisconnect(mDevice, "Playback stream failure"); + mDevice->handleDisconnect("Playback stream failure"); } mMainloop.getCondVar().notify_all(); } @@ -787,7 +787,7 @@ void PulsePlayback::streamWriteCallback(pa_stream *stream, size_t nbytes) noexce buflen = minz(buflen, nbytes); nbytes -= buflen; - aluMixData(mDevice, buf, static_cast<ALuint>(buflen/mFrameSize), mSpec.channels); + mDevice->renderSamples(buf, static_cast<ALuint>(buflen/mFrameSize), mSpec.channels); int ret{pa_stream_write(stream, buf, buflen, free_func, 0, PA_SEEK_RELATIVE)}; if UNLIKELY(ret != PA_OK) @@ -1188,7 +1188,7 @@ void PulseCapture::streamStateCallback(pa_stream *stream) noexcept if(pa_stream_get_state(stream) == PA_STREAM_FAILED) { ERR("Received stream failure!\n"); - aluHandleDisconnect(mDevice, "Capture stream failure"); + mDevice->handleDisconnect("Capture stream failure"); } mMainloop.getCondVar().notify_all(); } @@ -1364,14 +1364,14 @@ ALCenum PulseCapture::captureSamples(al::byte *buffer, ALCuint samples) const pa_stream_state_t state{pa_stream_get_state(mStream)}; if UNLIKELY(!PA_STREAM_IS_GOOD(state)) { - aluHandleDisconnect(mDevice, "Bad capture state: %u", state); + mDevice->handleDisconnect("Bad capture state: %u", state); break; } const void *capbuf; size_t caplen; if UNLIKELY(pa_stream_peek(mStream, &capbuf, &caplen) < 0) { - aluHandleDisconnect(mDevice, "Failed retrieving capture samples: %s", + mDevice->handleDisconnect("Failed retrieving capture samples: %s", pa_strerror(pa_context_errno(mContext))); break; } @@ -1402,7 +1402,7 @@ ALCuint PulseCapture::availableSamples() { const char *err{pa_strerror(static_cast<int>(got))}; ERR("pa_stream_readable_size() failed: %s\n", err); - aluHandleDisconnect(mDevice, "Failed getting readable size: %s", err); + mDevice->handleDisconnect("Failed getting readable size: %s", err); } else { diff --git a/alc/backends/sdl2.cpp b/alc/backends/sdl2.cpp index 7666b616..30335140 100644 --- a/alc/backends/sdl2.cpp +++ b/alc/backends/sdl2.cpp @@ -83,7 +83,7 @@ void Sdl2Backend::audioCallback(Uint8 *stream, int len) noexcept { const auto ulen = static_cast<unsigned int>(len); assert((ulen % mFrameSize) == 0); - aluMixData(mDevice, stream, ulen / mFrameSize, mDevice->channelsFromFmt()); + mDevice->renderSamples(stream, ulen / mFrameSize, mDevice->channelsFromFmt()); } void Sdl2Backend::open(const ALCchar *name) diff --git a/alc/backends/sndio.cpp b/alc/backends/sndio.cpp index bad05acb..c20ce496 100644 --- a/alc/backends/sndio.cpp +++ b/alc/backends/sndio.cpp @@ -79,7 +79,7 @@ int SndioPlayback::mixerProc() sio_initpar(&par); if(!sio_getpar(mSndHandle, &par)) { - aluHandleDisconnect(mDevice, "Failed to get device parameters"); + mDevice->handleDisconnect("Failed to get device parameters"); return 1; } @@ -95,14 +95,14 @@ int SndioPlayback::mixerProc() al::byte *WritePtr{mBuffer.data()}; size_t len{mBuffer.size()}; - aluMixData(mDevice, WritePtr, static_cast<ALuint>(len)/frameSize, frameStep); + mDevice->renderSamples(WritePtr, static_cast<ALuint>(len)/frameSize, frameStep); while(len > 0 && !mKillNow.load(std::memory_order_acquire)) { size_t wrote{sio_write(mSndHandle, WritePtr, len)}; if(wrote == 0) { ERR("sio_write failed\n"); - aluHandleDisconnect(mDevice, "Failed to write playback samples"); + mDevice->handleDisconnect("Failed to write playback samples"); break; } @@ -348,7 +348,7 @@ int SndioCapture::recordProc() size_t got{sio_read(mSndHandle, data.first.buf, minz(todo-total, data.first.len))}; if(!got) { - aluHandleDisconnect(mDevice, "Failed to read capture samples"); + mDevice->handleDisconnect("Failed to read capture samples"); break; } diff --git a/alc/backends/solaris.cpp b/alc/backends/solaris.cpp index 7f6ebb0f..6849a820 100644 --- a/alc/backends/solaris.cpp +++ b/alc/backends/solaris.cpp @@ -106,8 +106,7 @@ int SolarisBackend::mixerProc() if(errno == EINTR || errno == EAGAIN) continue; ERR("poll failed: %s\n", strerror(errno)); - aluHandleDisconnect(mDevice, "Failed to wait for playback buffer: %s", - strerror(errno)); + mDevice->handleDisconnect("Failed to wait for playback buffer: %s", strerror(errno)); break; } else if(pret == 0) @@ -118,7 +117,7 @@ int SolarisBackend::mixerProc() ALubyte *write_ptr{mBuffer.data()}; size_t to_write{mBuffer.size()}; - aluMixData(mDevice, write_ptr, to_write/frame_size, frame_step); + mDevice->renderSamples(write_ptr, static_cast<ALuint>(to_write/frame_size), frame_step); while(to_write > 0 && !mKillNow.load(std::memory_order_acquire)) { ssize_t wrote{write(mFd, write_ptr, to_write)}; @@ -127,12 +126,11 @@ int SolarisBackend::mixerProc() if(errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) continue; ERR("write failed: %s\n", strerror(errno)); - aluHandleDisconnect(mDevice, "Failed to write playback samples: %s", - strerror(errno)); + mDevice->handleDisconnect("Failed to write playback samples: %s", strerror(errno)); break; } - to_write -= wrote; + to_write -= static_cast<size_t>(wrote); write_ptr += wrote; } } diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp index 8e43aa7c..3b209e26 100644 --- a/alc/backends/wasapi.cpp +++ b/alc/backends/wasapi.cpp @@ -683,7 +683,7 @@ FORCE_ALIGN int WasapiPlayback::mixerProc() if(FAILED(hr)) { ERR("CoInitializeEx(nullptr, COINIT_MULTITHREADED) failed: 0x%08lx\n", hr); - aluHandleDisconnect(mDevice, "COM init failed: 0x%08lx", hr); + mDevice->handleDisconnect("COM init failed: 0x%08lx", hr); return 1; } @@ -699,7 +699,7 @@ FORCE_ALIGN int WasapiPlayback::mixerProc() if(FAILED(hr)) { ERR("Failed to get padding: 0x%08lx\n", hr); - aluHandleDisconnect(mDevice, "Failed to retrieve buffer padding: 0x%08lx", hr); + mDevice->handleDisconnect("Failed to retrieve buffer padding: 0x%08lx", hr); break; } mPadding.store(written, std::memory_order_relaxed); @@ -719,7 +719,7 @@ FORCE_ALIGN int WasapiPlayback::mixerProc() { { std::lock_guard<std::mutex> _{mMutex}; - aluMixData(mDevice, buffer, len, mFrameStep); + mDevice->renderSamples(buffer, len, mFrameStep); mPadding.store(written + len, std::memory_order_relaxed); } hr = mRender->ReleaseBuffer(len, 0); @@ -727,7 +727,7 @@ FORCE_ALIGN int WasapiPlayback::mixerProc() if(FAILED(hr)) { ERR("Failed to buffer data: 0x%08lx\n", hr); - aluHandleDisconnect(mDevice, "Failed to send playback samples: 0x%08lx", hr); + mDevice->handleDisconnect("Failed to send playback samples: 0x%08lx", hr); break; } } @@ -1233,7 +1233,7 @@ FORCE_ALIGN int WasapiCapture::recordProc() if(FAILED(hr)) { ERR("CoInitializeEx(nullptr, COINIT_MULTITHREADED) failed: 0x%08lx\n", hr); - aluHandleDisconnect(mDevice, "COM init failed: 0x%08lx", hr); + mDevice->handleDisconnect("COM init failed: 0x%08lx", hr); return 1; } @@ -1305,7 +1305,7 @@ FORCE_ALIGN int WasapiCapture::recordProc() if(FAILED(hr)) { - aluHandleDisconnect(mDevice, "Failed to capture samples: 0x%08lx", hr); + mDevice->handleDisconnect("Failed to capture samples: 0x%08lx", hr); break; } diff --git a/alc/backends/wave.cpp b/alc/backends/wave.cpp index 30a8399b..c452379e 100644 --- a/alc/backends/wave.cpp +++ b/alc/backends/wave.cpp @@ -146,10 +146,10 @@ int WaveBackend::mixerProc() } while(avail-done >= mDevice->UpdateSize) { - aluMixData(mDevice, mBuffer.data(), mDevice->UpdateSize, frameStep); + mDevice->renderSamples(mBuffer.data(), mDevice->UpdateSize, frameStep); done += mDevice->UpdateSize; - if(!IS_LITTLE_ENDIAN) + if /*constexpr*/(!IS_LITTLE_ENDIAN) { const ALuint bytesize{mDevice->bytesFromFmt()}; @@ -181,7 +181,7 @@ int WaveBackend::mixerProc() if(ferror(mFile)) { ERR("Error writing to file\n"); - aluHandleDisconnect(mDevice, "Failed to write playback samples"); + mDevice->handleDisconnect("Failed to write playback samples"); break; } } diff --git a/alc/backends/winmm.cpp b/alc/backends/winmm.cpp index 4dd74705..274536b3 100644 --- a/alc/backends/winmm.cpp +++ b/alc/backends/winmm.cpp @@ -199,7 +199,7 @@ FORCE_ALIGN int WinMMPlayback::mixerProc() WAVEHDR &waveHdr = mWaveBuffer[widx]; widx = (widx+1) % mWaveBuffer.size(); - aluMixData(mDevice, waveHdr.lpData, mDevice->UpdateSize, frame_step); + mDevice->renderSamples(waveHdr.lpData, mDevice->UpdateSize, frame_step); mWritable.fetch_sub(1, std::memory_order_acq_rel); waveOutWrite(mOutHdl, &waveHdr, sizeof(WAVEHDR)); } while(--todo); |