samplesWithLaterDTSsMayHaveEarlierPTSs(than:)
Tests for a later boundary in sample reordering.
Declaration
optional func samplesWithLaterDTSsMayHaveEarlierPTSs(than cursor: any MESampleCursor) -> BoolParameters
- cursor:
A sample cursor to use to test the sample reordering boundary.
Return Value
true if it’s possible that later samples in decode order can have an earlier presentation timestamp than that of the specified cursor; otherwise false.
Discussion
This method tests for a boundary in the reordering from decode order to presentation order. This determines when it’s possible for any sample later in decode order than the current sample to have an earllier presentation time than the current sample of the specified cursor. You can use this test to limit backward scans, such as to start forward playback. For example, with the argument cursor fixed, step the cursor forward until it’s impossible for any later-in-decode-order samples to be earlier-in-presentation-order than the argument cursor sample.
Don’t implement this method for formats where sample reordering doesn’t make sense for the track content, which also indicates that the samples aren’t reordered.
See Also
Stepping through samples
samplesWithEarlierDTSsMayHaveLaterPTSs(than:)estimatedSampleLocation()refineSampleLocation(_:refinementData:refinementDataLength:refinedLocation:)stepByDecodeTime(_:completionHandler:)stepByPresentationTime(_:completionHandler:)stepInDecodeOrder(by:completionHandler:)stepInPresentationOrder(by:completionHandler:)