Fix receive time corruption after f395d305

This commit is contained in:
Cameron Gutman
2019-04-30 23:15:40 -07:00
parent 4a82762118
commit a7d4537274
+13 -11
View File
@@ -666,26 +666,28 @@ void processRtpPayload(PNV_VIDEO_PACKET videoPacket, int length, unsigned long l
} }
// Add an RTP Packet to the queue // Add an RTP Packet to the queue
void queueRtpPacket(PRTPFEC_QUEUE_ENTRY queueEntry) { void queueRtpPacket(PRTPFEC_QUEUE_ENTRY queueEntryPtr) {
int dataOffset; int dataOffset;
RTPFEC_QUEUE_ENTRY queueEntry = *queueEntryPtr;
LC_ASSERT(!queueEntry->isParity); LC_ASSERT(!queueEntry.isParity);
LC_ASSERT(queueEntry->receiveTimeMs != 0); LC_ASSERT(queueEntry.receiveTimeMs != 0);
dataOffset = sizeof(*queueEntry->packet); dataOffset = sizeof(*queueEntry.packet);
if (queueEntry->packet->header & FLAG_EXTENSION) { if (queueEntry.packet->header & FLAG_EXTENSION) {
dataOffset += 4; // 2 additional fields dataOffset += 4; // 2 additional fields
} }
// Reuse the memory reserved for the RTPFEC_QUEUE_ENTRY to store the LENTRY_INTERNAL // Reuse the memory reserved for the RTPFEC_QUEUE_ENTRY to store the LENTRY_INTERNAL
// now that we're in the depacketizer. // now that we're in the depacketizer. We saved a copy of the real FEC queue entry
// on the stack here so we can safely modify this memory in place.
LC_ASSERT(sizeof(LENTRY_INTERNAL) <= sizeof(RTPFEC_QUEUE_ENTRY)); LC_ASSERT(sizeof(LENTRY_INTERNAL) <= sizeof(RTPFEC_QUEUE_ENTRY));
PLENTRY_INTERNAL existingEntry = (PLENTRY_INTERNAL)queueEntry; PLENTRY_INTERNAL existingEntry = (PLENTRY_INTERNAL)queueEntryPtr;
existingEntry->allocPtr = queueEntry->packet; existingEntry->allocPtr = queueEntry.packet;
processRtpPayload((PNV_VIDEO_PACKET)(((char*)queueEntry->packet) + dataOffset), processRtpPayload((PNV_VIDEO_PACKET)(((char*)queueEntry.packet) + dataOffset),
queueEntry->length - dataOffset, queueEntry.length - dataOffset,
queueEntry->receiveTimeMs, queueEntry.receiveTimeMs,
&existingEntry); &existingEntry);
if (existingEntry != NULL) { if (existingEntry != NULL) {