mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-04-11 02:06:15 +00:00
Improve FEC queue packet submission and retrieval from O(n) to O(1)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user