mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-06-18 14:51:30 +00:00
Use a 24-bit rounding mask to correctly round SPI and restore SPI asserts
This commit is contained in:
@@ -15,6 +15,8 @@ static int decodingFrame;
|
|||||||
static int strictIdrFrameWait;
|
static int strictIdrFrameWait;
|
||||||
static unsigned long long firstPacketReceiveTime;
|
static unsigned long long firstPacketReceiveTime;
|
||||||
|
|
||||||
|
#define TRUNCATE_24BIT(x) ((x) & 0xFFFFFF)
|
||||||
|
|
||||||
#define CONSECUTIVE_DROP_LIMIT 120
|
#define CONSECUTIVE_DROP_LIMIT 120
|
||||||
static int consecutiveFrameDrops;
|
static int consecutiveFrameDrops;
|
||||||
|
|
||||||
@@ -420,6 +422,7 @@ void processRtpPayload(PNV_VIDEO_PACKET videoPacket, int length, unsigned long l
|
|||||||
streamPacketIndex = videoPacket->streamPacketIndex;
|
streamPacketIndex = videoPacket->streamPacketIndex;
|
||||||
|
|
||||||
// The packets and frames must be in sequence from the FEC queue
|
// The packets and frames must be in sequence from the FEC queue
|
||||||
|
LC_ASSERT(!isBeforeSignedInt(streamPacketIndex, TRUNCATE_24BIT(lastPacketInStream + 1), 0));
|
||||||
LC_ASSERT(!isBeforeSignedInt(frameIndex, nextFrameNumber, 0));
|
LC_ASSERT(!isBeforeSignedInt(frameIndex, nextFrameNumber, 0));
|
||||||
|
|
||||||
// Notify the listener of the latest frame we've seen from the PC
|
// Notify the listener of the latest frame we've seen from the PC
|
||||||
@@ -451,7 +454,7 @@ void processRtpPayload(PNV_VIDEO_PACKET videoPacket, int length, unsigned long l
|
|||||||
|
|
||||||
// This must be the first packet in a frame or be contiguous with the last
|
// This must be the first packet in a frame or be contiguous with the last
|
||||||
// packet received.
|
// packet received.
|
||||||
LC_ASSERT(firstPacket || streamPacketIndex == lastPacketInStream + 1);
|
LC_ASSERT(firstPacket || streamPacketIndex == TRUNCATE_24BIT(lastPacketInStream + 1));
|
||||||
|
|
||||||
lastPacketInStream = streamPacketIndex;
|
lastPacketInStream = streamPacketIndex;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user