From 051ebec49fdf2ec2a26c383999008ed3b793af65 Mon Sep 17 00:00:00 2001 From: vsonnier Date: Sat, 18 Feb 2017 10:15:47 +0100 Subject: [PATCH] BLOCKING_QUEUE: let audio-out try_push() too, else it often blocks evrything while in debugger... --- src/demod/DemodulatorThread.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/demod/DemodulatorThread.cpp b/src/demod/DemodulatorThread.cpp index 2a32e71..a186404 100644 --- a/src/demod/DemodulatorThread.cpp +++ b/src/demod/DemodulatorThread.cpp @@ -299,7 +299,7 @@ void DemodulatorThread::run() { } if (!localAudioVisOutputQueue->try_push(ati_vis)) { - //non-blocking push for audio-out + //non-blocking push needed for audio vis out ati_vis->setRefCount(0); std::cout << "DemodulatorThread::run() cannot push ati_vis into localAudioVisOutputQueue, is full !" << std::endl; std::this_thread::yield(); @@ -308,8 +308,12 @@ void DemodulatorThread::run() { if (ati != nullptr) { if (!muted.load() && (!wxGetApp().getSoloMode() || (demodInstance == wxGetApp().getDemodMgr().getLastActiveDemodulator()))) { - - audioOutputQueue->push(ati); + //non-blocking push needed for audio out + if (!audioOutputQueue->try_push(ati)) { + ati->decRefCount(); + std::cout << "DemodulatorThread::run() cannot push ati into audioOutputQueue, is full !" << std::endl; + std::this_thread::yield(); + } } else { ati->setRefCount(0); }