Skip to content

macOS reads its own display instead of asserting it has none (#493) - #501

Merged
superuser404notfound merged 1 commit into
mainfrom
fix/ae493-macos-display-capabilities
Sep 6, 2026
Merged

superuser404notfound merged 1 commit into
mainfrom
fix/ae493-macos-display-capabilities

Conversation

@superuser404notfound

Copy link
Copy Markdown
Owner

Addresses the two halves of #493 that need no hedge. The Dolby Vision half (a host assertion) is a
separate round, so this does not close the issue.

Capability stub

AVPlayer.availableHDRModes is API_UNAVAILABLE(macos), so that branch had nothing to read for the
per-mode split and returned all false. effectiveVideoFormat clamps against it, which is how a DV
P8.1 on a 16" XDR resolved to .sdr. Now derived from AVPlayer.eligibleForHDRPlayback, which is
display-configuration aware and already reads false on an SDR-only Mac (#98).

supportsDolbyVision deliberately stays false. Eligibility proves EDR, not that AVFoundation will
accept a given DV variant on this display, and a refusal surfaces as -11868 with nothing playing.
NSScreen.maximumPotentialExtendedDynamicRangeColorComponentValue was the other candidate and is not
used: eligibility already answers on the reported hardware, and NSScreen is main-actor isolated while
this is read per load off the main actor.

Label branch

videoFormat went through presentedVideoFormat(panelPresentsHDR:) on macOS with a hard false,
since currentPanelIsHDR() is #if os(tvOS). iOS already sits outside that branch: a panel that
engages EDR on demand has no handshake to read. macOS composites EDR per window with no display mode
switch, so it belongs on the same branch.

One correction to the report, measured

The two halves do not overlap the way the title suggests. effectiveVideoFormat starts with
guard detected == .dolbyVision, so the capability stub only ever reached DV sources. A plain HDR10
clip through aetherctl play on macOS resolves effective-format=hdr10 before this change as well.
The "HDR10 and HLG play as SDR" symptom is the label branch alone, which is also why the reporter's
log shows videoRange=pq useMaster=true with effective-format=sdr: the served stream was never
downgraded.

3 new tests. Full suite green on both runners: XCTest 606 (1 skipped, 0 failures), swift-testing 2665
in 366 suites, REAL EXIT=0.

🤖 Generated with Claude Code

https://claude.ai/code/session_014tQ8MerNbZQdWBpDStitoD

… none (#493)

Two bugs with one root: the engine answered "what can this display present" from a per-platform
readout macOS never had.

`AVPlayer.availableHDRModes` is API_UNAVAILABLE(macos), so the capability branch there returned a
table of false. That is not "unknown", it is an assertion, and `effectiveVideoFormat` clamps a DV
source's PQ base against it, so a Dolby Vision title on an XDR display resolved to .sdr. Eligibility
is the honest answer for the two flavours that only need EDR, and Dolby Vision stays unclaimed:
eligibility proves EDR, not that AVFoundation will accept a DV variant, and a refusal costs -11868
with nothing playing. That one belongs to a host assertion, next round.

`videoFormat` took the tvOS branch on macOS, where `currentPanelIsHDR()` is a hard false, so every
HDR title was labelled SDR whatever the display was doing. iOS already sits outside that branch
because a panel that engages EDR on demand has no handshake to read. macOS composites EDR per window
with no display mode switch, which is the same physics, so it belongs there too. This is the half
that makes plain HDR10 and HLG read SDR; the capability stub only ever reached DV sources, measured
here with `aetherctl play` on a plain HDR10 clip, which resolved `effective-format=hdr10` before the
change as well.

3 new tests. Full suite green on both runners: XCTest 606 (1 skipped), swift-testing 2665 in 366
suites, exit 0.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_014tQ8MerNbZQdWBpDStitoD
@superuser404notfound
superuser404notfound merged commit 6d4f7ea into main Sep 6, 2026
5 checks passed
@superuser404notfound
superuser404notfound deleted the fix/ae493-macos-display-capabilities branch September 6, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant