diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-04-20 12:29:24 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-04-20 12:29:24 +0200 |
commit | 411d03ac6b8ee1a8c06f952b9378c90516a715b7 (patch) | |
tree | 3236a6121eb9137a79b82699006df877e3876c32 /src/MemlessPoly.cpp | |
parent | 4f9b087a578fac9dffef83cdcb41573468a4ae17 (diff) | |
download | dabmod-411d03ac6b8ee1a8c06f952b9378c90516a715b7.tar.gz dabmod-411d03ac6b8ee1a8c06f952b9378c90516a715b7.tar.bz2 dabmod-411d03ac6b8ee1a8c06f952b9378c90516a715b7.zip |
ThreadsafeQueue: add wakeup event instead of custom termination markers
This avoids the issue that the ~SDR termination marker doesn't reach the
consumer because it's still prebuffering
Diffstat (limited to 'src/MemlessPoly.cpp')
-rw-r--r-- | src/MemlessPoly.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/MemlessPoly.cpp b/src/MemlessPoly.cpp index 1e19071..88a68bc 100644 --- a/src/MemlessPoly.cpp +++ b/src/MemlessPoly.cpp @@ -280,9 +280,10 @@ void MemlessPoly::worker_thread(MemlessPoly::worker_t *workerdata) while (true) { worker_t::input_data_t in_data; - workerdata->in_queue.wait_and_pop(in_data); - - if (in_data.terminate) { + try { + workerdata->in_queue.wait_and_pop(in_data); + } + catch (const ThreadsafeQueueWakeup&) { break; } @@ -322,7 +323,6 @@ int MemlessPoly::internal_process(Buffer* const dataIn, Buffer* dataOut) size_t start = 0; for (auto& worker : m_workers) { worker_t::input_data_t dat; - dat.terminate = false; dat.dpd_type = m_dpd_type; dat.lut_scalefactor = m_lut_scalefactor; dat.lut = m_lut.data(); |