mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 03:23:07 +00:00
Fix decoding of misaligned start sequences.
This commit is contained in:
parent
c631649867
commit
d5665ac318
@ -101,9 +101,7 @@ public class NvVideoStream {
|
|||||||
|
|
||||||
System.out.println("VID: First frame read ("+offset+" bytes)");
|
System.out.println("VID: First frame read ("+offset+" bytes)");
|
||||||
|
|
||||||
// FIXME: Investigate: putting these NALs into the data stream
|
depacketizer.addInputData(new AvVideoPacket(new AvByteBufferDescriptor(firstFrame, 0, offset)));
|
||||||
// causes the picture to get messed up
|
|
||||||
//depacketizer.addInputData(new AvPacket(new AvBufferDescriptor(firstFrame, 0, offset)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setupRtpSession(String host) throws SocketException
|
public void setupRtpSession(String host) throws SocketException
|
||||||
|
@ -111,17 +111,21 @@ public class AvVideoDepacketizer {
|
|||||||
avcNalDataChain = new LinkedList<AvByteBufferDescriptor>();
|
avcNalDataChain = new LinkedList<AvByteBufferDescriptor>();
|
||||||
avcNalDataLength = 0;
|
avcNalDataLength = 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Not either sequence we want
|
|
||||||
//currentlyDecoding = AvDecodeUnit.TYPE_UNKNOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Skip the start sequence
|
// Skip the start sequence
|
||||||
location.length -= specialSeq.length;
|
location.length -= specialSeq.length;
|
||||||
location.offset += specialSeq.length;
|
location.offset += specialSeq.length;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Not either sequence we want
|
||||||
|
currentlyDecoding = AvDecodeUnit.TYPE_UNKNOWN;
|
||||||
|
|
||||||
|
// Just skip this byte
|
||||||
|
location.length--;
|
||||||
|
location.offset++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Move to the next special sequence
|
// Move to the next special sequence
|
||||||
while (location.length != 0)
|
while (location.length != 0)
|
||||||
@ -142,7 +146,6 @@ public class AvVideoDepacketizer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AvByteBufferDescriptor data = new AvByteBufferDescriptor(location.data, start, location.offset-start);
|
AvByteBufferDescriptor data = new AvByteBufferDescriptor(location.data, start, location.offset-start);
|
||||||
|
|
||||||
if (currentlyDecoding == AvDecodeUnit.TYPE_H264 && avcNalDataChain != null)
|
if (currentlyDecoding == AvDecodeUnit.TYPE_H264 && avcNalDataChain != null)
|
||||||
{
|
{
|
||||||
// Add a buffer descriptor describing the NAL data in this packet
|
// Add a buffer descriptor describing the NAL data in this packet
|
||||||
|
Loading…
x
Reference in New Issue
Block a user