mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-11-10 04:37:37 +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) {
|
void selectStream(std::string name) {
|
||||||
|
std::lock_guard<std::recursive_mutex> lck(recMtx);
|
||||||
deselectStream();
|
deselectStream();
|
||||||
audioStream = sigpath::sinkManager.bindStream(name);
|
audioStream = sigpath::sinkManager.bindStream(name);
|
||||||
if (!audioStream) { return; }
|
if (!audioStream) { return; }
|
||||||
@ -188,7 +189,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void deselectStream() {
|
void deselectStream() {
|
||||||
|
std::lock_guard<std::recursive_mutex> lck(recMtx);
|
||||||
if (selectedStreamName.empty() || !audioStream) { return; }
|
if (selectedStreamName.empty() || !audioStream) { return; }
|
||||||
|
if (recording && recMode == RECORDER_MODE_AUDIO) { stop(); }
|
||||||
splitter.stop();
|
splitter.stop();
|
||||||
sigpath::sinkManager.unbindStream(selectedStreamName, audioStream);
|
sigpath::sinkManager.unbindStream(selectedStreamName, audioStream);
|
||||||
selectedStreamName = "";
|
selectedStreamName = "";
|
||||||
|
Loading…
Reference in New Issue
Block a user