diff --git a/Controller.cpp b/Controller.cpp index 3f2100b..f10fcc7 100644 --- a/Controller.cpp +++ b/Controller.cpp @@ -204,14 +204,18 @@ void CController::ReadReflector() dstar_device[devnum]->packet_queue.push(packet); //increment the dstar vocoder index IncrementDStarVocoder(); - // encode the audio to dmr - devnum = current_dmr_vocoder / 3; - //send the audio to the corrent dmr vocoder - dmr_device[devnum]->SendAudio(current_dmr_vocoder%3, packet->GetAudio()); - //push the packet onto the dmr vocoder's queue - dmr_device[devnum]->packet_queue.push(packet); - //increment the dmr vocoder index - IncrementDMRVocoder(); + { + // encode the audio to dmr + // make a second shared ptr to the same packet + auto packet2 = std::make_shared(packet); + devnum = current_dmr_vocoder / 3; + //send the audio to the corrent dmr vocoder + dmr_device[devnum]->SendAudio(current_dmr_vocoder%3, packet2->GetAudio()); + //push the packet onto the dmr vocoder's queue + dmr_device[devnum]->packet_queue.push(packet2); + //increment the dmr vocoder index + IncrementDMRVocoder(); + } break; case ECodecType::none: default: diff --git a/TranscoderPacket.cpp b/TranscoderPacket.cpp index f460568..0b4b00f 100644 --- a/TranscoderPacket.cpp +++ b/TranscoderPacket.cpp @@ -87,7 +87,7 @@ void CTranscoderPacket::SetDStarData(const uint8_t *dstar) memcpy(tcpacket.dstar, dstar, 9); dstar_set = true; } -void CTranscoderPacket::SetDMRData(const uint8_t *dmr ) +void CTranscoderPacket::SetDMRData(const uint8_t *dmr) { memcpy(tcpacket.dmr, dmr, 9); dmr_set = true;