diff --git a/Controller.cpp b/Controller.cpp index f10fcc7..fd8cc8c 100644 --- a/Controller.cpp +++ b/Controller.cpp @@ -204,18 +204,15 @@ void CController::ReadReflector() dstar_device[devnum]->packet_queue.push(packet); //increment the dstar vocoder index IncrementDStarVocoder(); - { - // 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(); - } + // 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(); + std::cout << "USE COUNT: " << packet.use_count() << std::endl; break; case ECodecType::none: default: @@ -274,6 +271,7 @@ void CController::ReadAmbeDevices() if (FD_ISSET(dmr_device[i]->GetFd(), &FdSet)) { ReadDevice(dmr_device[i], EAmbeType::dmr); + std::cout << "Read DMR device " << i << std::endl; } } }