Skip to content

fix(routing): exempt DV Profile 5 from the VT capability probe gate (#176) - #182

Merged
superuser404notfound merged 1 commit into
mainfrom
fix/176-dv-p5-vt-probe-bypass
Jul 21, 2026
Merged

superuser404notfound merged 1 commit into
mainfrom
fix/176-dv-p5-vt-probe-bypass

Conversation

@superuser404notfound

Copy link
Copy Markdown
Owner

Fixes #176.

Problem

A DV Profile 5 HEVC MKV on an M4 Mac mini played through the software path with a green/purple color shift. The reporter's log shows the #2 second-stage gate misfiring:

[VTProbe] canHardwareDecode codec=173 3840x2160 -> false (status=-4)
[AetherEngine] codec=173 not hardware-decodable by VideoToolbox; routing to the software path so it plays instead of a black screen (#2)
[SWDecoder] Opened: 3840x2160, codec=hevc, threads=10, 8-bit

Root cause

VTCapabilityProbe.canHardwareDecode builds a plain-HEVC format description from the raw hvcC and asks VT for a hardware session. For DV Profile 5 that is not representative of what the native route actually plays: the muxer emits dvh1 + dvcC and Apple's DV decoder handles it (device-verified in #98, including tonemapping on non-DV panels). VT rejects the bare P5 hvcC with -12906/-4 even on Apple Silicon, so the probe returns a false negative and the #2 fallback routes P5 to the SoftwarePlaybackHost.

The software path then decodes the IPT-PQ-c2 base layer as YCbCr, which is exactly the green/purple cast from the screenshot (same symptom class as the pre-dvh1 era of #4). P5 has no HDR10/HLG/SDR-compatible base layer, so software is never a correct fallback for it, regardless of what VT says.

Fix

VideoRoutingPolicy.forcesSoftwareForUndecodableFormat now takes the DOVI profile and a probe closure. HEVC + DV profile 5 bypasses the gate and stays native unconditionally; the closure form means the VT probe is not even invoked for P5. P7 / P8.x keep the gate since their base layer is standard Main10 that the software path decodes with correct color (and where the Intel / older Apple TV fallback of #2 remains valid).

Verification

  • New policy tests: P5 stays native with a refusing probe, P5 never invokes the probe, P7/P8 keep the gate, H.264 ignores the P5 exemption. 899/899 tests pass.
  • swift build -Xswiftc -strict-concurrency=complete clean.
  • tvOS Simulator xcodebuild clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NAPCg4tCDdSqkK6tPkNptw

…176)

The #2 second-stage gate probes VideoToolbox with a plain-HEVC format
description built from the raw hvcC. For DV Profile 5 that probe is not
representative of the native route (dvh1 + dvcC, decoded by Apple's DV
decoder) and rejects it with -12906/-4 even on Apple Silicon, wrongly
routing P5 to the software path. There libavcodec decodes the IPT-PQ-c2
signal as YCbCr, producing the reported green/purple cast. P5 has no
compatible base layer, so software is never a correct fallback for it.

HEVC streams whose DOVI config says profile 5 now bypass the gate and
stay native unconditionally; the probe closure is not even invoked.
P7 / P8.x keep the gate since their base layer is standard Main10 that
the software path decodes with correct color.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NAPCg4tCDdSqkK6tPkNptw
@superuser404notfound
superuser404notfound merged commit 1e75281 into main Jul 21, 2026
3 checks passed
@superuser404notfound
superuser404notfound deleted the fix/176-dv-p5-vt-probe-bypass branch July 21, 2026 16:24
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.

DV P5 displaying a green-purple color shift

1 participant