mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-24 00:34:44 +01:00
thread safety + stop recorder on audio stream deselect
This commit is contained in:
parent
3421aae9a2
commit
869b3e0abd
@ -180,6 +180,7 @@ public:
|
||||
}
|
||||
|
||||
void selectStream(std::string name) {
|
||||
std::lock_guard<std::recursive_mutex> lck(recMtx);
|
||||
deselectStream();
|
||||
audioStream = sigpath::sinkManager.bindStream(name);
|
||||
if (!audioStream) { return; }
|
||||
@ -188,7 +189,9 @@ public:
|
||||
}
|
||||
|
||||
void deselectStream() {
|
||||
std::lock_guard<std::recursive_mutex> lck(recMtx);
|
||||
if (selectedStreamName.empty() || !audioStream) { return; }
|
||||
if (recording && recMode == RECORDER_MODE_AUDIO) { stop(); }
|
||||
splitter.stop();
|
||||
sigpath::sinkManager.unbindStream(selectedStreamName, audioStream);
|
||||
selectedStreamName = "";
|
||||
|
Loading…
x
Reference in New Issue
Block a user