mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-06-22 00:31:09 +00:00
Fix large frame header size for GFE 3.26
This commit is contained in:
+18
-7
@@ -697,13 +697,24 @@ static void processRtpPayload(PNV_VIDEO_PACKET videoPacket, int length,
|
|||||||
|
|
||||||
// If this is the first packet, skip the frame header (if one exists)
|
// If this is the first packet, skip the frame header (if one exists)
|
||||||
if (firstPacket) {
|
if (firstPacket) {
|
||||||
if (APP_VERSION_AT_LEAST(7, 1, 415)) {
|
if (APP_VERSION_AT_LEAST(7, 1, 446)) {
|
||||||
// >= 7.1.415
|
// >= 7.1.446 uses 2 different header lengths based on the first byte:
|
||||||
// The first IDR frame now has smaller headers than the rest. We seem to be able to tell
|
// 0x01 indicates an 8 byte header
|
||||||
// them apart by looking at the first byte. It will be 0x81 for the long header and 0x01
|
// 0x81 indicates a 41 byte header
|
||||||
// for the short header.
|
if (currentPos.data[0] == 0x01) {
|
||||||
// TODO: This algorithm seems to actually work on GFE 3.18 (first byte always 0x01), so
|
currentPos.offset += 8;
|
||||||
// maybe we could unify this codepath in the future.
|
currentPos.length -= 8;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LC_ASSERT(currentPos.data[0] == (char)0x81);
|
||||||
|
currentPos.offset += 41;
|
||||||
|
currentPos.length -= 41;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (APP_VERSION_AT_LEAST(7, 1, 415)) {
|
||||||
|
// [7.1.415, 7.1.446) uses 2 different header lengths based on the first byte:
|
||||||
|
// 0x01 indicates an 8 byte header
|
||||||
|
// 0x81 indicates a 24 byte header
|
||||||
if (currentPos.data[0] == 0x01) {
|
if (currentPos.data[0] == 0x01) {
|
||||||
currentPos.offset += 8;
|
currentPos.offset += 8;
|
||||||
currentPos.length -= 8;
|
currentPos.length -= 8;
|
||||||
|
|||||||
Reference in New Issue
Block a user