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:
NanoTech 2016-09-09 23:59:02 -06:00
parent a9f7b1aeab
commit 2d08f568e9

View File

@ -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;