From c2c6a5808feac1993fbe6befe2685b03bb67535d Mon Sep 17 00:00:00 2001 From: Tom Early Date: Wed, 22 Dec 2021 12:11:04 -0700 Subject: [PATCH] more checking --- DV3003.cpp | 18 +++++++++--------- DV3003.h | 2 -- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/DV3003.cpp b/DV3003.cpp index 364af0b..4d940a4 100644 --- a/DV3003.cpp +++ b/DV3003.cpp @@ -437,15 +437,6 @@ void CDV3003::FeedDevice() } else // no packet is in the input queue { - #ifdef DEBUG - static unsigned int maxsize = 0; - unsigned int s = inq.size(); - if (s > maxsize) - { - std::cout << "inq size=" << s << std::endl; - maxsize = s; - } - #endif std::this_thread::sleep_for(std::chrono::milliseconds(5)); } } @@ -530,6 +521,15 @@ void CDV3003::ReadDevice() void CDV3003::AddPacket(const std::shared_ptr packet) { inq.push(packet); + #ifdef DEBUG + static unsigned int maxsize = 0; + unsigned int s = inq.size(); + if (s > maxsize) + { + std::cout << "inq size=" << s << std::endl; + maxsize = s; + } + #endif } bool CDV3003::SendAudio(const uint8_t channel, const int16_t *audio) const diff --git a/DV3003.h b/DV3003.h index 253172c..e0aba13 100644 --- a/DV3003.h +++ b/DV3003.h @@ -118,9 +118,7 @@ private: std::atomic ch_depth, sp_depth; std::atomic keep_running; CPacketQueue vocq[3]; // we need a queue for each vocoder - std::mutex voc_mux[3]; CPacketQueue inq; // and input queue - std::mutex in_mux; std::future feedFuture, readFuture; std::string devicepath, productid, version;