diff --git a/reflector/M17Protocol.cpp b/reflector/M17Protocol.cpp index fa7e48b..0936c29 100644 --- a/reflector/M17Protocol.cpp +++ b/reflector/M17Protocol.cpp @@ -379,19 +379,16 @@ void CM17Protocol::HandleQueue(void) std::vector& buf = partialFrames[module]; - ECodecType cType = m_StreamsCache[module].m_dvHeader.GetCodecIn(); - int bytesPerFrame = (cType == ECodecType::c2_1600) ? 4 : 8; + ECodecType cType = ECodecType::c2_3200; + // Force header to match what we are sending (tcd always sends 3200) + m_StreamsCache[module].m_dvHeader.SetCodecIn(cType); + + int bytesPerFrame = 8; // Safety check if (bytesPerFrame > 16) bytesPerFrame = 16; - int offset = 0; - if (bytesPerFrame == 8) { // C2_3200 - offset = (seq % 2) * 8; - } - - // std::cout << "DEBUG: HandleQueue Mod=" << module << " Seq=" << seq << " Offset=" << offset << " BufSizeBefore=" << buf.size() << std::endl; - std::cout << "DEBUG: HandleQueue Mod=" << module << " Seq=" << seq << " Offset=" << offset << " BufSizeBefore=" << buf.size() << std::endl; + int offset = (seq % 2) * 8; buf.insert(buf.end(), data + offset, data + offset + bytesPerFrame); diff --git a/reflector/Packet.h b/reflector/Packet.h index 6c299d6..2f44351 100644 --- a/reflector/Packet.h +++ b/reflector/Packet.h @@ -72,6 +72,7 @@ public: void SetLocalOrigin(void) { m_eOrigin = EOrigin::local; } void SetRemotePeerOrigin(void) { m_eOrigin = EOrigin::peer; } void SetImrsPacketFrameId(uint8_t id) { m_uiImrsPacketFrameId = id; } + void SetCodecIn(ECodecType type) { m_eCodecIn = type; } protected: // network