From ab80b55219ccfddccbd25458776ee79686fc682d Mon Sep 17 00:00:00 2001 From: Tom Early Date: Tue, 11 Jan 2022 15:05:49 -0700 Subject: [PATCH] no timeout for ProcessC2Thread --- Controller.cpp | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/Controller.cpp b/Controller.cpp index 6bfd402..2d65327 100644 --- a/Controller.cpp +++ b/Controller.cpp @@ -292,25 +292,22 @@ void CController::ProcessC2Thread() while (keep_running) { auto packet = codec2_queue.pop(); - if (packet) + + switch (packet->GetCodecIn()) { - switch (packet->GetCodecIn()) - { - case ECodecType::c2_1600: - case ECodecType::c2_3200: - // this is an original M17 packet, so decode it to audio - // Codec2toAudio will send it on for AMBE processing - Codec2toAudio(packet); - break; - case ECodecType::dstar: - case ECodecType::dmr: - // codec_in was AMBE, so we need to calculate the the M17 data - AudiotoCodec2(packet); - break; - } + case ECodecType::c2_1600: + case ECodecType::c2_3200: + // this is an original M17 packet, so decode it to audio + // Codec2toAudio will send it on for AMBE processing + Codec2toAudio(packet); + break; + + case ECodecType::dstar: + case ECodecType::dmr: + // codec_in was AMBE, so we need to calculate the the M17 data + AudiotoCodec2(packet); + break; } - else - std::this_thread::sleep_for(std::chrono::milliseconds(5)); } }