mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-06 16:06:10 +00:00
Fix off-by-one when looking for an I-frame NAL
Between finding the NAL and checking its type, reassembleFrame is called and overwrites the cachedSpecialDesc with the data and NAL type from the previous NAL. If the only IDR NAL in the packet is the last NAL in the packet, it gets missed and the depacketizer is stuck waiting for it.
This commit is contained in:
@@ -274,6 +274,9 @@ public class VideoDepacketizer {
|
||||
// Reassemble any pending NAL
|
||||
reassembleFrame(packet.getFrameIndex());
|
||||
|
||||
// Reload cachedSpecialDesc after reassembleFrame overwrote it
|
||||
NAL.getSpecialSequenceDescriptor(location, cachedSpecialDesc);
|
||||
|
||||
if (isReferencePictureNalu(cachedSpecialDesc.data[cachedSpecialDesc.offset+cachedSpecialDesc.length])) {
|
||||
// This is the NALU code for I-frame data
|
||||
waitingForIdrFrame = false;
|
||||
|
||||
Reference in New Issue
Block a user