mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-21 12:03:02 +00:00
Revert "Fix waiting for IDR frames"
This reverts commit 37f0abfcd1e1490315e2f321db7d313d91e29cc6.
This commit is contained in:
parent
9728c136f5
commit
35a50209be
@ -91,24 +91,10 @@ public class VideoDepacketizer {
|
|||||||
flags |= DecodeUnit.DU_FLAG_CODEC_CONFIG;
|
flags |= DecodeUnit.DU_FLAG_CODEC_CONFIG;
|
||||||
break;
|
break;
|
||||||
case 0x65:
|
case 0x65:
|
||||||
waitingForIdrFrame = false;
|
|
||||||
flags |= DecodeUnit.DU_FLAG_SYNC_FRAME;
|
flags |= DecodeUnit.DU_FLAG_SYNC_FRAME;
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
// Other frames types require IDR frames to precede them
|
|
||||||
if (waitingForIdrFrame) {
|
|
||||||
LimeLog.warning("Waiting for IDR frame");
|
|
||||||
dropAvcFrameState();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
|
||||||
LimeLog.severe("Internal video depacketizer error: Invalid frame start");
|
|
||||||
controlListener.connectionSinkTooSlow(0, 0);
|
|
||||||
dropAvcFrameState();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Construct the H264 decode unit
|
// Construct the H264 decode unit
|
||||||
DecodeUnit du = decodedUnits.pollFreeObject();
|
DecodeUnit du = decodedUnits.pollFreeObject();
|
||||||
@ -173,6 +159,11 @@ public class VideoDepacketizer {
|
|||||||
avcFrameDataChain = new LinkedList<ByteBufferDescriptor>();
|
avcFrameDataChain = new LinkedList<ByteBufferDescriptor>();
|
||||||
avcFrameDataLength = 0;
|
avcFrameDataLength = 0;
|
||||||
packetSet = new HashSet<VideoPacket>();
|
packetSet = new HashSet<VideoPacket>();
|
||||||
|
|
||||||
|
if (cachedSpecialDesc.data[cachedSpecialDesc.offset+cachedSpecialDesc.length] == 0x65) {
|
||||||
|
// This is the NALU code for I-frame data
|
||||||
|
waitingForIdrFrame = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip the start sequence
|
// Skip the start sequence
|
||||||
@ -181,6 +172,12 @@ public class VideoDepacketizer {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Check if this is padding after a full AVC frame
|
||||||
|
if (isDecodingH264 && NAL.isPadding(cachedSpecialDesc)) {
|
||||||
|
// The decode unit is complete
|
||||||
|
reassembleAvcFrame(packet.getFrameIndex());
|
||||||
|
}
|
||||||
|
|
||||||
// Not decoding AVC
|
// Not decoding AVC
|
||||||
isDecodingH264 = false;
|
isDecodingH264 = false;
|
||||||
|
|
||||||
@ -385,6 +382,14 @@ public class VideoDepacketizer {
|
|||||||
waitingForNextSuccessfulFrame = false;
|
waitingForNextSuccessfulFrame = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we need an IDR frame first, then drop this frame
|
||||||
|
if (waitingForIdrFrame) {
|
||||||
|
LimeLog.warning("Waiting for IDR frame");
|
||||||
|
|
||||||
|
dropAvcFrameState();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
reassembleAvcFrame(frameIndex);
|
reassembleAvcFrame(frameIndex);
|
||||||
|
|
||||||
startFrameNumber = nextFrameNumber;
|
startFrameNumber = nextFrameNumber;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user