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
@ -141,8 +141,7 @@ import java.util.regex.Pattern;
|
|||||||
throw new ParserException("X-TIMESTAMP-MAP doesn't contain media timestamp: " + line);
|
throw new ParserException("X-TIMESTAMP-MAP doesn't contain media timestamp: " + line);
|
||||||
}
|
}
|
||||||
vttTimestampUs = WebvttParserUtil.parseTimestampUs(localTimestampMatcher.group(1));
|
vttTimestampUs = WebvttParserUtil.parseTimestampUs(localTimestampMatcher.group(1));
|
||||||
tsTimestampUs = TimestampAdjuster.ptsToUs(
|
tsTimestampUs = TimestampAdjuster.ptsToUs(Long.parseLong(mediaTimestampMatcher.group(1)));
|
||||||
Long.parseLong(mediaTimestampMatcher.group(1)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,8 +154,8 @@ import java.util.regex.Pattern;
|
|||||||
}
|
}
|
||||||
|
|
||||||
long firstCueTimeUs = WebvttParserUtil.parseTimestampUs(cueHeaderMatcher.group(1));
|
long firstCueTimeUs = WebvttParserUtil.parseTimestampUs(cueHeaderMatcher.group(1));
|
||||||
long sampleTimeUs = timestampAdjuster.adjustSampleTimestamp(
|
long sampleTimeUs = timestampAdjuster.adjustTsTimestamp(
|
||||||
firstCueTimeUs + tsTimestampUs - vttTimestampUs);
|
TimestampAdjuster.usToPts(firstCueTimeUs + tsTimestampUs - vttTimestampUs));
|
||||||
long subsampleOffsetUs = sampleTimeUs - firstCueTimeUs;
|
long subsampleOffsetUs = sampleTimeUs - firstCueTimeUs;
|
||||||
// Output the track.
|
// Output the track.
|
||||||
TrackOutput trackOutput = buildTrackOutput(subsampleOffsetUs);
|
TrackOutput trackOutput = buildTrackOutput(subsampleOffsetUs);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user