zakrent 2020-12-26 01:17:37 +01:00
commit 717f2a822b
4 zmienionych plików z 12 dodań i 13 usunięć

Wyświetl plik

@ -179,6 +179,7 @@ private:
}
void doStop() {
s2m.stop();
monoRB.stop();
stereoRB.stop();
monoRB.data.stopReader();

Wyświetl plik

@ -6,6 +6,7 @@ namespace sdrpp_credits {
"aosync",
"Alexsey Shestacov",
"Benjamin Kyd",
"Cropinghigh",
"Tobias Mädel",
"Raov",
"Howard0su"

Wyświetl plik

@ -38,10 +38,7 @@ namespace dsp {
swapCV.wait(lck, [this]{ return (canSwap || writerStop); });
// If writer was stopped, abandon operation
if (writerStop) {
writerStop = false;
return false;
}
if (writerStop) { return false; }
// Swap buffers
dataSize = size;
@ -66,23 +63,22 @@ namespace dsp {
std::unique_lock<std::mutex> lck(rdyMtx);
rdyCV.wait(lck, [this]{ return (dataReady || readerStop); });
// If stopped, abort
if (readerStop) {
readerStop = false;
return -1;
}
dataReady = false;
return dataSize;
return (readerStop ? -1 : dataSize);
}
void flush() {
// Clear data ready
{
std::lock_guard<std::mutex> lck(rdyMtx);
dataReady = false;
}
// Notify writer that buffers can be swapped
{
std::lock_guard<std::mutex> lck(swapMtx);
canSwap = true;
}
swapCV.notify_all();
}

Wyświetl plik

@ -224,6 +224,7 @@ I will soon publish a contributing.md listing the code style to use.
* [aosync](https://github.com/aosync)
* [Alexsey Shestacov](https://github.com/wingrime)
* [Benjamin Kyd](https://github.com/benkyd)
* [cropinghigh](https://github.com/cropinghigh)
* [Tobias Mädel](https://github.com/Manawyrm)
* [Raov](https://twitter.com/raov_birbtog)
* [Howard0su](https://github.com/howard0su)