mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Refine sample presentation time validation for negative PTS workaround
In case of negative PTS workaround, instead of disallowing all cases where samples are not in presentation order, we now validate that the first sample's presentation time is the smallest. This adjustment allows for correctly applying an offset to ensure all samples have a presentation time >= 0. #cherrypick PiperOrigin-RevId: 673434793
This commit is contained in:
parent
bb3d055191
commit
d9a678483b
@ -201,12 +201,13 @@ import java.util.Map;
|
||||
trackTokenToLastPresentationTimeUs.put(trackToken, presentationTimeUs);
|
||||
|
||||
checkState(
|
||||
presentationTimeOffsetUs == 0 || presentationTimeUs >= lastSamplePresentationTimeUs,
|
||||
"Samples not in presentation order ("
|
||||
+ presentationTimeUs
|
||||
+ " < "
|
||||
+ lastSamplePresentationTimeUs
|
||||
+ ") unsupported when using negative PTS workaround");
|
||||
presentationTimeOffsetUs == 0 || presentationTimeUs >= 0,
|
||||
String.format(
|
||||
Locale.US,
|
||||
"Sample presentation time (%d) < first sample presentation time (%d). Ensure the first"
|
||||
+ " sample has the smallest timestamp when using the negative PTS workaround.",
|
||||
presentationTimeUs - presentationTimeOffsetUs,
|
||||
-presentationTimeOffsetUs));
|
||||
bufferInfo.set(bufferInfo.offset, bufferInfo.size, presentationTimeUs, bufferInfo.flags);
|
||||
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user