mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-06-22 00:31:09 +00:00
Fix handling of a drop pattern where OOS packets are late but in contiguous order from the previous point
This commit is contained in:
+8
-1
@@ -92,7 +92,7 @@ static void removeEntryFromList(PRTPV_QUEUE_LIST list, PRTPV_QUEUE_ENTRY entry)
|
|||||||
// newEntry is contained within the packet buffer so we free the whole entry by freeing entry->packet
|
// newEntry is contained within the packet buffer so we free the whole entry by freeing entry->packet
|
||||||
static bool queuePacket(PRTP_VIDEO_QUEUE queue, PRTPV_QUEUE_ENTRY newEntry, PRTP_PACKET packet, int length, bool isParity, bool isFecRecovery) {
|
static bool queuePacket(PRTP_VIDEO_QUEUE queue, PRTPV_QUEUE_ENTRY newEntry, PRTP_PACKET packet, int length, bool isParity, bool isFecRecovery) {
|
||||||
PRTPV_QUEUE_ENTRY entry;
|
PRTPV_QUEUE_ENTRY entry;
|
||||||
bool outOfSequence = false;
|
bool outOfSequence;
|
||||||
|
|
||||||
LC_ASSERT(!(isFecRecovery && isParity));
|
LC_ASSERT(!(isFecRecovery && isParity));
|
||||||
LC_ASSERT(!isBefore16(packet->sequenceNumber, queue->nextContiguousSequenceNumber));
|
LC_ASSERT(!isBefore16(packet->sequenceNumber, queue->nextContiguousSequenceNumber));
|
||||||
@@ -102,8 +102,15 @@ static bool queuePacket(PRTP_VIDEO_QUEUE queue, PRTPV_QUEUE_ENTRY newEntry, PRTP
|
|||||||
// packet, the fast path will stop working and we'll use the loop instead.
|
// packet, the fast path will stop working and we'll use the loop instead.
|
||||||
if (packet->sequenceNumber == queue->nextContiguousSequenceNumber) {
|
if (packet->sequenceNumber == queue->nextContiguousSequenceNumber) {
|
||||||
queue->nextContiguousSequenceNumber = U16(packet->sequenceNumber + 1);
|
queue->nextContiguousSequenceNumber = U16(packet->sequenceNumber + 1);
|
||||||
|
|
||||||
|
// If we received the next contiguous sequence number but already have missing
|
||||||
|
// packets, that means we received some later packets before falling back into
|
||||||
|
// sequence with this one. By definition, that's OOS data so let's tag it.
|
||||||
|
outOfSequence = queue->missingPackets != 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
outOfSequence = false;
|
||||||
|
|
||||||
// Check for duplicates
|
// Check for duplicates
|
||||||
entry = queue->pendingFecBlockList.head;
|
entry = queue->pendingFecBlockList.head;
|
||||||
while (entry != NULL) {
|
while (entry != NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user