---
title: "samplesWithEarlierDTSsMayHaveLaterPTSs(than:)"
framework: MediaExtension
role: symbol
role_heading: Instance Method
platforms: [macOS 14.0+]
path: "mediaextension/mesamplecursor/sampleswithearlierdtssmayhavelaterptss(than:)"
---

# samplesWithEarlierDTSsMayHaveLaterPTSs(than:)

Tests for an earlier boundary in sample reordering.

## Declaration

```swift
optional func samplesWithEarlierDTSsMayHaveLaterPTSs(than cursor: any MESampleCursor) -> Bool
```

## Parameters

- `cursor`: A sample cursor to use to test the sample reordering boundary.

## Return Value

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

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. important: Only pass a cursor to this method that references the same sequence of samples as the cursor you call this method on, such as that the same instance of METrackReader created. Otherwise, the result is undefined.

## See Also

### Stepping through samples

- [samplesWithLaterDTSsMayHaveEarlierPTSs(than:)](mediaextension/mesamplecursor/sampleswithlaterdtssmayhaveearlierptss(than:).md)
- [estimatedSampleLocation()](mediaextension/mesamplecursor/estimatedsamplelocation().md)
- [refineSampleLocation(_:refinementData:refinementDataLength:refinedLocation:)](mediaextension/mesamplecursor/refinesamplelocation(_:refinementdata:refinementdatalength:refinedlocation:).md)
- [stepByDecodeTime(_:completionHandler:)](mediaextension/mesamplecursor/stepbydecodetime(_:completionhandler:).md)
- [stepByPresentationTime(_:completionHandler:)](mediaextension/mesamplecursor/stepbypresentationtime(_:completionhandler:).md)
- [stepInDecodeOrder(by:completionHandler:)](mediaextension/mesamplecursor/stepindecodeorder(by:completionhandler:).md)
- [stepInPresentationOrder(by:completionHandler:)](mediaextension/mesamplecursor/stepinpresentationorder(by:completionhandler:).md)
