<!--
{
  "availability" : [
    "macOS: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaExtension",
  "identifier" : "/documentation/MediaExtension/MESampleCursor/samplesWithEarlierDTSsMayHaveLaterPTSs(than:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MediaExtension"
    ],
    "preciseIdentifier" : "c:objc(pl)MESampleCursor(im)samplesWithEarlierDTSsMayHaveLaterPTSsThanCursor:"
  },
  "title" : "samplesWithEarlierDTSsMayHaveLaterPTSs(than:)"
}
-->

# samplesWithEarlierDTSsMayHaveLaterPTSs(than:)

Tests for an earlier boundary in sample reordering.

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

## Parameters

`cursor`

A sample cursor to use to test the sample reordering boundary.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if it’s possible that earlier samples in decode order can have a later presentation timestamp than that of the specified cursor; otherwise <doc://com.apple.documentation/documentation/Swift/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.

> 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 ``doc://com.apple.mediaextension/documentation/MediaExtension/METrackReader`` created. Otherwise, the result is undefined.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)