clean up some M17 last-packet errors

This commit is contained in:
Tom Early committed 2021-12-08 13:06:40 -07:00
1 parent 3518f2bcec
commit 36af26a330
3 files changed
+9 -3

No files matched your search

-3
View File
@@ -178,9 +178,6 @@ void CCodecStream::Task(void)
m_StatsTimer.start();
m_uiTotalPackets++;
m_TCWriter.Send(Frame->GetCodecPacket());
#ifdef DEBUG
std::cout << "Sent a packet to the transcoder from module '" << Frame->GetCodecPacket()->module << "'" << std::endl;
#endif
// and push to our local queue
m_LocalQueue.push(Packet);
+8
View File
@@ -73,8 +73,16 @@ void CM17Protocol::Task(void)
{
OnDvHeaderPacketIn(Header, Ip);
// xrf needs a voice frame every 20 ms and an M17 frame is 40 ms, so we need a duplicate
auto secondFrame = std::unique_ptr<CDvFramePacket>(new CDvFramePacket(*Frame.get()));
// This is a "first" packet, so clear the last packet status, since the real last packet it the secondFrame
if (Frame->IsLastPacket())
Frame->SetLastPacket(false);
// push the "first" packet
OnDvFramePacketIn(Frame, &Ip);
// push the "second" packet
OnDvFramePacketIn(secondFrame, &Ip); // push two packet because we need a packet every 20 ms
}
}
+1
View File
@@ -67,6 +67,7 @@ public:
// set
void UpdatePids(const uint32_t);
void SetPacketModule(char cMod) { m_cModule = cMod; }
void SetLastPacket(bool value) { m_bLastPacket = value; }
void SetLocalOrigin(void) { m_eOrigin = EOrigin::local; }
void SetRemotePeerOrigin(void) { m_eOrigin = EOrigin::peer; }