mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-06-17 22:31:21 +00:00
Disable FEC on Gen 4 and earlier and assert that FLAG_EXTENSION is present
This commit is contained in:
+13
-2
@@ -108,8 +108,9 @@ static int reconstructFrame(PRTP_FEC_QUEUE queue) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEC_VALIDATION_MODE
|
#ifdef FEC_VALIDATION_MODE
|
||||||
// If FEC is disabled for this frame, we must bail early here.
|
// If FEC is disabled or unsupported for this frame, we must bail early here.
|
||||||
if (queue->fecPercentage == 0 && queue->receivedBufferDataPackets == queue->bufferDataPackets) {
|
if ((queue->fecPercentage == 0 || AppVersionQuad[0] < 5) &&
|
||||||
|
queue->receivedBufferDataPackets == queue->bufferDataPackets) {
|
||||||
#else
|
#else
|
||||||
if (queue->receivedBufferDataPackets == queue->bufferDataPackets) {
|
if (queue->receivedBufferDataPackets == queue->bufferDataPackets) {
|
||||||
#endif
|
#endif
|
||||||
@@ -117,6 +118,13 @@ static int reconstructFrame(PRTP_FEC_QUEUE queue) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (AppVersionQuad[0] < 5) {
|
||||||
|
// Our FEC recovery code doesn't work properly until Gen 5
|
||||||
|
Limelog("FEC recovery not supported on Gen %d servers\n",
|
||||||
|
AppVersionQuad[0]);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
reed_solomon* rs = NULL;
|
reed_solomon* rs = NULL;
|
||||||
unsigned char** packets = malloc(totalPackets * sizeof(unsigned char*));
|
unsigned char** packets = malloc(totalPackets * sizeof(unsigned char*));
|
||||||
unsigned char* marks = malloc(totalPackets * sizeof(unsigned char));
|
unsigned char* marks = malloc(totalPackets * sizeof(unsigned char));
|
||||||
@@ -393,6 +401,9 @@ int RtpfAddPacket(PRTP_FEC_QUEUE queue, PRTP_PACKET packet, int length, PRTPFEC_
|
|||||||
return RTPF_RET_REJECTED;
|
return RTPF_RET_REJECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FLAG_EXTENSION is required for all supported versions of GFE.
|
||||||
|
LC_ASSERT(packet->header & FLAG_EXTENSION);
|
||||||
|
|
||||||
int dataOffset = sizeof(*packet);
|
int dataOffset = sizeof(*packet);
|
||||||
if (packet->header & FLAG_EXTENSION) {
|
if (packet->header & FLAG_EXTENSION) {
|
||||||
dataOffset += 4; // 2 additional fields
|
dataOffset += 4; // 2 additional fields
|
||||||
|
|||||||
Reference in New Issue
Block a user