samplesWithEarlierDTSsMayHaveLaterPTSs(than:)
Tests for an earlier boundary in sample reordering.
Declaration
optional func samplesWithEarlierDTSsMayHaveLaterPTSs(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 earlier samples in decode order can have a later 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 earlier in decode order than the current sample to have a later 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 backward until it’s impossible for any earlier-in-decode-order samples to be later-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
samplesWithLaterDTSsMayHaveEarlierPTSs(than:)estimatedSampleLocation()refineSampleLocation(_:refinementData:refinementDataLength:refinedLocation:)stepByDecodeTime(_:completionHandler:)stepByPresentationTime(_:completionHandler:)stepInDecodeOrder(by:completionHandler:)stepInPresentationOrder(by:completionHandler:)