Improve FEC queue packet submission and retrieval from O(n) to O(1)

This commit is contained in:
Cameron Gutman committed 2019-04-25 23:02:01 -07:00
1 parent f395d3056a
commit fe7cb006da
3 files changed
+94 -95

No files matched your search

+2 -9
View File
@@ -122,15 +122,8 @@ static void ReceiveThreadProc(void* context) {
packet->sequenceNumber = htons(packet->sequenceNumber);
queueStatus = RtpfAddPacket(&rtpQueue, packet, err, (PRTPFEC_QUEUE_ENTRY)&buffer[receiveSize]);
if (queueStatus == RTPF_RET_QUEUED_PACKETS_READY) {
// The packet queue now has packets ready
buffer = NULL;
while ((queueEntry = RtpfGetQueuedPacket(&rtpQueue)) != NULL) {
// queueRtpPacket takes ownership of the packet
queueRtpPacket(queueEntry);
}
}
else if (queueStatus == RTPF_RET_QUEUED_NOTHING_READY) {
if (queueStatus == RTPF_RET_QUEUED) {
// The queue owns the buffer
buffer = NULL;
}