mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 03:23:07 +00:00
Remove some unneccessary checks and repurpose an old method.
This commit is contained in:
parent
20514a7ce8
commit
e507f4abfb
@ -241,29 +241,20 @@ class NAL {
|
|||||||
// This assumes that the buffer passed in is already a special sequence
|
// This assumes that the buffer passed in is already a special sequence
|
||||||
public static boolean isAvcStartSequence(AvByteBufferDescriptor specialSeq)
|
public static boolean isAvcStartSequence(AvByteBufferDescriptor specialSeq)
|
||||||
{
|
{
|
||||||
if (specialSeq.length != 3 && specialSeq.length != 4)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// The start sequence is 00 00 01 or 00 00 00 01
|
// The start sequence is 00 00 01 or 00 00 00 01
|
||||||
return (specialSeq.data[specialSeq.offset+specialSeq.length-1] == 0x01);
|
return (specialSeq.data[specialSeq.offset+specialSeq.length-1] == 0x01);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This assumes that the buffer passed in is already a special sequence
|
// This assumes that the buffer passed in is already a special sequence
|
||||||
public static boolean isUnknownStartSequence(AvByteBufferDescriptor specialSeq)
|
public static boolean isPadding(AvByteBufferDescriptor specialSeq)
|
||||||
{
|
{
|
||||||
if (specialSeq.length != 3)
|
// The padding sequence is 00 00 00
|
||||||
return false;
|
return (specialSeq.data[specialSeq.offset+specialSeq.length-1] == 0x00);
|
||||||
|
|
||||||
// The start sequence is 00 00 03
|
|
||||||
return (specialSeq.data[specialSeq.offset+specialSeq.length-1] == 0x03);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This assumes that the buffer passed in is already a special sequence
|
// This assumes that the buffer passed in is already a special sequence
|
||||||
public static boolean isAvcFrameStart(AvByteBufferDescriptor specialSeq)
|
public static boolean isAvcFrameStart(AvByteBufferDescriptor specialSeq)
|
||||||
{
|
{
|
||||||
if (specialSeq.length != 4)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// The frame start sequence is 00 00 00 01
|
// The frame start sequence is 00 00 00 01
|
||||||
return (specialSeq.data[specialSeq.offset+specialSeq.length-1] == 0x01);
|
return (specialSeq.data[specialSeq.offset+specialSeq.length-1] == 0x01);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user