make sure we don't send the back a packet twice

main
Tom Early 4 years ago
parent defb76bb4e
commit b226aad52f

@ -257,12 +257,9 @@ void CController::AudiotoCodec2(std::shared_ptr<CTranscoderPacket> packet)
packet->SetM17Data(m17data); packet->SetM17Data(m17data);
} }
// we might be all done... // we might be all done...
if (packet->AllCodecsAreSet())
{
send_mux.lock(); send_mux.lock();
SendToReflector(packet); if (packet->AllCodecsAreSet()) SendToReflector(packet);
send_mux.unlock(); send_mux.unlock();
}
} }
// The original incoming coded was M17, so we will calculate the audio and then // The original incoming coded was M17, so we will calculate the audio and then
@ -358,10 +355,10 @@ void CController::RouteDstPacket(std::shared_ptr<CTranscoderPacket> packet)
codec2_queue.push(packet); codec2_queue.push(packet);
dmrsf_device->AddPacket(packet); dmrsf_device->AddPacket(packet);
} }
else if (packet->AllCodecsAreSet()) else
{ {
send_mux.lock(); send_mux.lock();
SendToReflector(packet); if (packet->AllCodecsAreSet()) SendToReflector(packet);
send_mux.unlock(); send_mux.unlock();
} }
} }
@ -373,10 +370,10 @@ void CController::RouteDmrPacket(std::shared_ptr<CTranscoderPacket> packet)
codec2_queue.push(packet); codec2_queue.push(packet);
dstar_device->AddPacket(packet); dstar_device->AddPacket(packet);
} }
else if (packet->AllCodecsAreSet()) else
{ {
send_mux.lock(); send_mux.lock();
SendToReflector(packet); if (packet->AllCodecsAreSet()) SendToReflector(packet);
send_mux.unlock(); send_mux.unlock();
} }
} }

@ -27,7 +27,7 @@ int main()
if (Controller.Start()) if (Controller.Start())
return EXIT_FAILURE; return EXIT_FAILURE;
std::cout << "Hybrid Transcoder version 0.0.0 successfully started" << std::endl; std::cout << "Hybrid Transcoder version 0.0.1 successfully started" << std::endl;
pause(); pause();

Loading…
Cancel
Save

Powered by TurnKey Linux.