mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-21 12:03:02 +00:00
Decode parameter set NALs with the slow path so the SPS fixup hack still works
This commit is contained in:
parent
0cce5b021e
commit
26809c4b6b
@ -56,7 +56,6 @@ public class VideoDepacketizer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Legacy depacketizer */
|
|
||||||
public void addInputDataSlow(VideoPacket packet, ByteBufferDescriptor location)
|
public void addInputDataSlow(VideoPacket packet, ByteBufferDescriptor location)
|
||||||
{
|
{
|
||||||
while (location.length != 0)
|
while (location.length != 0)
|
||||||
@ -159,17 +158,9 @@ public class VideoDepacketizer {
|
|||||||
{
|
{
|
||||||
ByteBufferDescriptor location = packet.getNewPayloadDescriptor();
|
ByteBufferDescriptor location = packet.getNewPayloadDescriptor();
|
||||||
|
|
||||||
// Runt packets can go directly to the decoder
|
// Runt packets get decoded using the slow path
|
||||||
if (location.length < 968)
|
if (location.length < 968) {
|
||||||
{
|
addInputDataSlow(packet, location);
|
||||||
avcNalDataChain = new LinkedList<ByteBufferDescriptor>();
|
|
||||||
avcNalDataLength = 0;
|
|
||||||
|
|
||||||
avcNalDataChain.add(location);
|
|
||||||
avcNalDataLength += location.length;
|
|
||||||
|
|
||||||
reassembleAvcNal();
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,6 +182,17 @@ public class VideoDepacketizer {
|
|||||||
splitFrame = false;
|
splitFrame = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (firstPacket)
|
||||||
|
{
|
||||||
|
if (NAL.getSpecialSequenceDescriptor(location, cachedDesc) && NAL.isAvcFrameStart(cachedDesc)
|
||||||
|
&& cachedDesc.data[cachedDesc.offset+cachedDesc.length] == 0x67)
|
||||||
|
{
|
||||||
|
// SPS and PPS prefix is padded between NALs, so we must decode it with the slow path
|
||||||
|
addInputDataSlow(packet, location);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
addInputDataFast(packet, location, firstPacket);
|
addInputDataFast(packet, location, firstPacket);
|
||||||
|
|
||||||
if (!splitFrame && packetIndex + 1 == packetsInFrame) {
|
if (!splitFrame && packetIndex + 1 == packetsInFrame) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user