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)");
|
||||
|
||||
// FIXME: Investigate: putting these NALs into the data stream
|
||||
// causes the picture to get messed up
|
||||
//depacketizer.addInputData(new AvPacket(new AvBufferDescriptor(firstFrame, 0, offset)));
|
||||
depacketizer.addInputData(new AvVideoPacket(new AvByteBufferDescriptor(firstFrame, 0, offset)));
|
||||
}
|
||||
|
||||
public void setupRtpSession(String host) throws SocketException
|
||||
|
@ -111,16 +111,20 @@ public class AvVideoDepacketizer {
|
||||
avcNalDataChain = new LinkedList<AvByteBufferDescriptor>();
|
||||
avcNalDataLength = 0;
|
||||
}
|
||||
|
||||
// Skip the start sequence
|
||||
location.length -= specialSeq.length;
|
||||
location.offset += specialSeq.length;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not either sequence we want
|
||||
//currentlyDecoding = AvDecodeUnit.TYPE_UNKNOWN;
|
||||
}
|
||||
currentlyDecoding = AvDecodeUnit.TYPE_UNKNOWN;
|
||||
|
||||
// Skip the start sequence
|
||||
location.length -= specialSeq.length;
|
||||
location.offset += specialSeq.length;
|
||||
// Just skip this byte
|
||||
location.length--;
|
||||
location.offset++;
|
||||
}
|
||||
}
|
||||
|
||||
// Move to the next special sequence
|
||||
@ -142,7 +146,6 @@ public class AvVideoDepacketizer {
|
||||
}
|
||||
|
||||
AvByteBufferDescriptor data = new AvByteBufferDescriptor(location.data, start, location.offset-start);
|
||||
|
||||
if (currentlyDecoding == AvDecodeUnit.TYPE_H264 && avcNalDataChain != null)
|
||||
{
|
||||
// Add a buffer descriptor describing the NAL data in this packet
|
||||
|
Loading…
x
Reference in New Issue
Block a user