From 8cda5d0ee492dc595f879d71c6ea9850db212e87 Mon Sep 17 00:00:00 2001 From: Yauhen Pahrabniak Date: Mon, 2 Oct 2023 15:44:16 +0200 Subject: [PATCH] removed mutex --- src/CSoundInput.cpp | 3 --- src/CSoundInput.h | 2 -- 2 files changed, 5 deletions(-) diff --git a/src/CSoundInput.cpp b/src/CSoundInput.cpp index 24cb421..1df2f60 100644 --- a/src/CSoundInput.cpp +++ b/src/CSoundInput.cpp @@ -36,7 +36,6 @@ CSoundInput::~CSoundInput() } BASS_RecordFree(); - std::unique_lock lock{ inputMutex }; delete encoder; delete opusBuffer; rnnoise_destroy(denoiser); @@ -250,8 +249,6 @@ void CSoundInput::SetNoiseSuppressionEnabled(const bool enabled) BOOL CSoundInput::OnSoundFrame(HRECORD handle, const void* buffer, DWORD length, void* user) { const auto self = static_cast(user); - std::unique_lock lock{ self->inputMutex }; - for (int i = 0; i < length; i += (FRAME_SIZE_SAMPLES * sizeof(short))) { self->SoundFrameCaptured(handle, (char*)buffer + i, FRAME_SIZE_SAMPLES * sizeof(short)); diff --git a/src/CSoundInput.h b/src/CSoundInput.h index ab824ef..7894ff4 100644 --- a/src/CSoundInput.h +++ b/src/CSoundInput.h @@ -42,8 +42,6 @@ class CSoundInput : public ISoundInput bool recording = false; bool deviceLost = false; bool isDefault = true; - - std::mutex inputMutex; public: CSoundInput(int _bitRate); ~CSoundInput() override;