mirror of
https://github.com/nostar/urfd.git
synced 2026-11-08 04:19:39 +00:00
clean up some M17 last-packet errors
This commit is contained in:
1 parent
3518f2bcec
commit
36af26a330
3 files changed
+9
-3
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
Reference in new issue
Block a user