mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-07-01 23:35:58 +00:00
Try to recover if the frame header parsing fails
This commit is contained in:
parent
54825845e7
commit
3ae777f973
@ -744,11 +744,15 @@ static void processRtpPayload(PNV_VIDEO_PACKET videoPacket, int length,
|
||||
// Other versions don't have a frame header at all
|
||||
}
|
||||
|
||||
// Assert that the 3 or 4 byte Annex B NALU prefix is next
|
||||
LC_ASSERT(currentPos.data[currentPos.offset + 0] == 0);
|
||||
LC_ASSERT(currentPos.data[currentPos.offset + 1] == 0);
|
||||
LC_ASSERT(currentPos.data[currentPos.offset + 2] == 0 || currentPos.data[currentPos.offset + 2] == 1);
|
||||
LC_ASSERT(currentPos.data[currentPos.offset + 3] == 1 || currentPos.data[currentPos.offset + 2] == 1);
|
||||
// The Annex B NALU start prefix must be next
|
||||
if (!getAnnexBStartSequence(¤tPos, NULL)) {
|
||||
// If we aren't starting on a start prefix, something went wrong.
|
||||
LC_ASSERT(false);
|
||||
|
||||
// For release builds, we will try to recover by searching for one.
|
||||
// This mimics the way most decoders handle this situation.
|
||||
skipToNextNal(¤tPos);
|
||||
}
|
||||
|
||||
// If an AUD NAL is prepended to this frame data, remove it.
|
||||
// Other parts of this code are not prepared to deal with a
|
||||
|
Loading…
x
Reference in New Issue
Block a user