mirror of
https://github.com/samsonjs/media.git
synced 2026-04-08 11:45:51 +00:00
Fix FLV AVCVIDEOPACKET -> compositionTimeMs Type from UI 24 to SI 24
This commit is contained in:
parent
f9249d23ea
commit
4f8f87221e
1 changed files with 3 additions and 0 deletions
|
|
@ -80,6 +80,9 @@ import com.google.android.exoplayer2.video.AvcConfig;
|
|||
protected void parsePayload(ParsableByteArray data, long timeUs) throws ParserException {
|
||||
int packetType = data.readUnsignedByte();
|
||||
int compositionTimeMs = data.readUnsignedInt24();
|
||||
// compositionTimeMs is signed int 24, change unsigned int 24 to signed int 24
|
||||
compositionTimeMs = (compositionTimeMs & 0x800000) >> 23 == 1 ? (compositionTimeMs & 0xff000000) : compositionTimeMs;
|
||||
|
||||
timeUs += compositionTimeMs * 1000L;
|
||||
// Parse avc sequence header in case this was not done before.
|
||||
if (packetType == AVC_PACKET_TYPE_SEQUENCE_HEADER && !hasOutputFormat) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue