fixed routing bug for AMBE codec_in

main
Tom Early 4 years ago
parent fd6381c70c
commit de5decceb7

@ -281,13 +281,16 @@ void CController::RouteDstPacket(std::shared_ptr<CTranscoderPacket> packet)
{ {
if (ECodecType::dstar == packet->GetCodecIn()) if (ECodecType::dstar == packet->GetCodecIn())
{ {
// codec_in is dstar, the audio has just completed, so now calc the DMR // codec_in is dstar, the audio has just completed, so now calc the M17 and DMR
c2_mux.lock();
codec2_queue.push(packet);
c2_mux.unlock();
add_dmr_mux.lock(); add_dmr_mux.lock();
dmr_device.AddPacket(packet); dmr_device.AddPacket(packet);
add_dmr_mux.unlock(); add_dmr_mux.unlock();
#ifdef DEBUG #ifdef DEBUG
if (packet->IsLast()) if (packet->IsLast())
Dump(packet, "Routed to dmr:"); Dump(packet, "DStar audio routed to codec2 and dmr:");
#endif #endif
} }
else if (packet->AllCodecsAreSet()) else if (packet->AllCodecsAreSet())
@ -302,12 +305,15 @@ void CController::RouteDmrPacket(std::shared_ptr<CTranscoderPacket> packet)
{ {
if (ECodecType::dmr == packet->GetCodecIn()) if (ECodecType::dmr == packet->GetCodecIn())
{ {
c2_mux.lock();
codec2_queue.push(packet);
c2_mux.unlock();
add_dst_mux.lock(); add_dst_mux.lock();
dstar_device.AddPacket(packet); dstar_device.AddPacket(packet);
add_dst_mux.unlock(); add_dst_mux.unlock();
#ifdef DEBUG #ifdef DEBUG
if (packet->IsLast()) if (packet->IsLast())
Dump(packet, "Routed to dstar:"); Dump(packet, "DMR audio routed to dstar:");
#endif #endif
} }
else if (packet->AllCodecsAreSet()) else if (packet->AllCodecsAreSet())

@ -405,8 +405,6 @@ void CDV3003::FeedDevice()
break; break;
} }
std::this_thread::sleep_for(std::chrono::milliseconds(5)); std::this_thread::sleep_for(std::chrono::milliseconds(5));
std::cout << "depth: ch=" << ch_depth << " sp=" << sp_depth << std::endl;
std::cout.flush();
} }
if (keep_running) if (keep_running)

Loading…
Cancel
Save

Powered by TurnKey Linux.