Skip to content

5.16.1

Choose a tag to compare

@superuser404notfound superuser404notfound released this 21 Jul 05:28

Fixed

nativeRemoteHLS: HDR10 / Dolby Vision presented no video (audio-only, black); dynamic range always reported SDR (#168)

An HDR10 (PQ) 4K HEVC Main10 50 fps live stream over nativeRemoteHLS reached readyToPlay and playing, decoded audio, and showed a black screen with no video track. VLC (its own VTDecompressionSession and display handling) and Android render the same channel fine.

Root cause. The nativeRemoteHLS bypass hands the m3u8 straight to AVPlayer and runs no demux probe, by design. Two things follow from that: it never programmed AVDisplayManager.preferredDisplayCriteria for the item, and it never learned the item's dynamic range (so videoFormat stayed at its .sdr default, which is what a host reads back as fmt=sdr). On a bare AVPlayerLayer, an HDR item with the panel in an SDR mode reaches readyToPlay and advances the clock on audio but presents no video. The loopback path avoids this because it programs the criteria manually from its libav probe. appliesPreferredDisplayCriteriaAutomatically (the "let AVKit manage it" switch) is an AVPlayerViewController property and does not exist on the bare AVPlayer this path uses, so there was no automatic path either.

Fix. The engine now reads the dynamic range back from AVPlayer's already-parsed video-track CMFormatDescription (transfer function to HDR10 / HLG, dvh1 / dvhe sample type to Dolby Vision) at readyToPlay and again at the first presented frame (an HLS video track can be absent from item.tracks at the readyToPlay instant). It publishes the result into sourceVideoFormat / videoFormat, and for an HDR range programs preferredDisplayCriteria (Match Dynamic Range plus Match Frame Rate, since the item is 50 fps) exactly as the loopback path does. There is no second connection to the origin (which matters for per-token IPTV origins); the read piggybacks on AVPlayer's own parse. SDR needs no panel switch, and sole-writer hosts (suppressDisplayCriteria) are left untouched.

This addresses the display-negotiation gap. If a future origin's single-variant master is one AVPlayer rejects outright (no video track ever built), that is a separate failure this change does not cover.

The pure pieces are extracted for coverage: the transfer/subtype to VideoFormat classifier and the HDR apply-gate are pinned in RemoteHLSFormatDetectionTests.

Reported by a downstream integrator on a Stalker-portal IPTV channel (Apple TV 4K, tvOS 26.0; HDR10 4K HEVC Main10 / L5.1 / 50 fps). Awaiting reporter device retest.

Full macOS suite green (860 tests, 0 failures), strict-concurrency clean, iOS and tvOS Simulator builds succeed.

Full Changelog: 5.16.0...5.16.1