diff --git a/misc_modules/recorder/src/main.cpp b/misc_modules/recorder/src/main.cpp index 77bec880..a0a30988 100644 --- a/misc_modules/recorder/src/main.cpp +++ b/misc_modules/recorder/src/main.cpp @@ -180,6 +180,7 @@ public: } void selectStream(std::string name) { + std::lock_guard lck(recMtx); deselectStream(); audioStream = sigpath::sinkManager.bindStream(name); if (!audioStream) { return; } @@ -188,7 +189,9 @@ public: } void deselectStream() { + std::lock_guard lck(recMtx); if (selectedStreamName.empty() || !audioStream) { return; } + if (recording && recMode == RECORDER_MODE_AUDIO) { stop(); } splitter.stop(); sigpath::sinkManager.unbindStream(selectedStreamName, audioStream); selectedStreamName = "";