mirror of
https://github.com/samsonjs/media.git
synced 2026-03-28 09:55:48 +00:00
Fix PTS wraparound in HLS+Webvtt
Issue:#2928 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=169246424
This commit is contained in:
parent
5b0e693419
commit
fed2a1a6ea
1 changed files with 3 additions and 4 deletions
|
|
@ -141,8 +141,7 @@ import java.util.regex.Pattern;
|
|||
throw new ParserException("X-TIMESTAMP-MAP doesn't contain media timestamp: " + line);
|
||||
}
|
||||
vttTimestampUs = WebvttParserUtil.parseTimestampUs(localTimestampMatcher.group(1));
|
||||
tsTimestampUs = TimestampAdjuster.ptsToUs(
|
||||
Long.parseLong(mediaTimestampMatcher.group(1)));
|
||||
tsTimestampUs = TimestampAdjuster.ptsToUs(Long.parseLong(mediaTimestampMatcher.group(1)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -155,8 +154,8 @@ import java.util.regex.Pattern;
|
|||
}
|
||||
|
||||
long firstCueTimeUs = WebvttParserUtil.parseTimestampUs(cueHeaderMatcher.group(1));
|
||||
long sampleTimeUs = timestampAdjuster.adjustSampleTimestamp(
|
||||
firstCueTimeUs + tsTimestampUs - vttTimestampUs);
|
||||
long sampleTimeUs = timestampAdjuster.adjustTsTimestamp(
|
||||
TimestampAdjuster.usToPts(firstCueTimeUs + tsTimestampUs - vttTimestampUs));
|
||||
long subsampleOffsetUs = sampleTimeUs - firstCueTimeUs;
|
||||
// Output the track.
|
||||
TrackOutput trackOutput = buildTrackOutput(subsampleOffsetUs);
|
||||
|
|
|
|||
Loading…
Reference in a new issue