From 3f9ea1d01b357647a07884a6c9931506e865d290 Mon Sep 17 00:00:00 2001 From: jackun Date: Wed, 10 Feb 2021 13:09:39 +0200 Subject: [PATCH] USB: remove lingering `if` and lock pulseaudio's recording ringbuffer earlier just in case --- pcsx2/USB/usb-mic/audiodev-pulse.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pcsx2/USB/usb-mic/audiodev-pulse.cpp b/pcsx2/USB/usb-mic/audiodev-pulse.cpp index d56b38cf2c..8a90437ac2 100644 --- a/pcsx2/USB/usb-mic/audiodev-pulse.cpp +++ b/pcsx2/USB/usb-mic/audiodev-pulse.cpp @@ -743,10 +743,11 @@ namespace usb_mic if (padev->mPaused /*|| dur > 5000*/ || (!padata && nbytes /* hole */)) { ret = pa_stream_drop(p); - if (ret != PA_OK) return; } + std::lock_guard lock(padev->mMutex); + padev->mInBuffer.write((uint8_t*)padata, nbytes); //if copy succeeded, drop samples at pulse's side @@ -781,7 +782,6 @@ namespace usb_mic break; //TODO happens? padev->mInBuffer.read(samples); } - std::lock_guard lock(padev->mMutex); size_t output_samples = output_frames_gen * padev->GetChannels(); float* pSrc = rebuf.data();