From ed49cc87221ae260ba1ef11b5e32e34a573e9ec8 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Sun, 19 Dec 2021 12:41:15 -0700 Subject: [PATCH] another bug in the processing flow --- Controller.cpp | 18 ++++++++++++------ Main.cpp | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Controller.cpp b/Controller.cpp index fccd8eb..df6ec7f 100644 --- a/Controller.cpp +++ b/Controller.cpp @@ -320,8 +320,11 @@ void CController::FeedAmbesThread() auto vocnum = current_dstar_vocoder % 3; //push the packet onto the vocoder's queue dstar_device[devnum]->packet_queue[vocnum].push(packet); - // send the audio to the current dstar vocoder - dstar_device[devnum]->SendAudio(vocnum, packet->GetAudio()); + // send the correct thing to the current dstar vocoder + if (ECodecType::dstar == packet->GetCodecIn()) + dstar_device[devnum]->SendData(vocnum, packet->GetDStarData()); + else + dstar_device[devnum]->SendAudio(vocnum, packet->GetAudio()); dstar_depth++; // increment the dstar vocoder index IncrementDStarVocoder(); @@ -339,8 +342,11 @@ void CController::FeedAmbesThread() auto vocnum = current_dmr_vocoder % 3; // push the packet onto the dmr vocoder's queue dmr_device[devnum]->packet_queue[vocnum].push(packet); - // send the audio to the corrent dmr vocoder - dmr_device[devnum]->SendAudio(vocnum, packet->GetAudio()); + // send the correct thing to the corrent dmr vocoder + if (ECodecType::dmr == packet->GetCodecIn()) + dmr_device[devnum]->SendData(vocnum, packet->GetDMRData()); + else + dmr_device[devnum]->SendAudio(vocnum, packet->GetAudio()); dmr_depth++; // increment the dmr vocoder index IncrementDMRVocoder(); @@ -447,15 +453,15 @@ void CController::ReadDevice(std::shared_ptr device, EAmbeType type) { dstar_mux.lock(); packet = device->packet_queue[devpacket.field_id-PKT_CHANNEL0].pop(); - dstar_depth--; dstar_mux.unlock(); + dstar_depth--; } else { dmr_mux.lock(); packet = device->packet_queue[devpacket.field_id-PKT_CHANNEL0].pop(); - dmr_depth--; dmr_mux.unlock(); + dmr_depth--; } if (is_audio) diff --git a/Main.cpp b/Main.cpp index 5f2ceb5..b2c4032 100644 --- a/Main.cpp +++ b/Main.cpp @@ -25,7 +25,7 @@ int main() if (controller.Start()) return EXIT_FAILURE; - std::cout << "Hybrid Transcoder Version #211214 Successfully started" << std::endl; + std::cout << "Hybrid Transcoder Version #211219 Successfully started" << std::endl; pause();