Skip to content

Commit

Permalink
removed mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
emcifuntik committed Oct 2, 2023
1 parent 2a7558c commit 8cda5d0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/CSoundInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ CSoundInput::~CSoundInput()
}
BASS_RecordFree();

std::unique_lock lock{ inputMutex };
delete encoder;
delete opusBuffer;
rnnoise_destroy(denoiser);
Expand Down Expand Up @@ -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<CSoundInput*>(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));
Expand Down
2 changes: 0 additions & 2 deletions src/CSoundInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8cda5d0

Please sign in to comment.