Skip to content

5.22.0

Choose a tag to compare

@superuser404notfound superuser404notfound released this 25 Jul 08:13

The running session can confirm its own Dolby Atmos tracks (LoadOptions.confirmAtmos)

5.21.0 made an authoritative E-AC-3 JOC check available, but only as a static one-shot probe. A host that wanted an honest Atmos badge while something was playing still had to open the source a second time itself, run its own pass, and patch its own copy of the track list. Every host would have written the same code.

Set confirmAtmos and the engine does it:

var options = LoadOptions()
options.confirmAtmos = true
try await engine.load(url: url, options: options)
// engine.audioTracks republishes with an honest isAtmos as tracks confirm.

There is no new API to read and nothing to poll. Any surface already bound to the published audioTracks (a track picker, a stats panel, a badge) starts telling the truth on its own.

How it behaves

The pass is armed at the end of load on every backend, so it sits behind the session rather than in front of the first frame, and it runs at utility priority. It opens at most one extra handle on the source at a time, uses the same bounded decode as probeDetectingAtmos (AtmosDetectionOptions caps: 64 packets, 8 MiB, 2 seconds per track), and opens with skipStreamInfo, since codec_id and codec_type come off the container header and find_stream_info would be pure cost for a background enrichment nobody is waiting on.

Every E-AC-3 track is scanned, not only the one playing. A track picker that labels one entry Atmos and leaves an identical sibling blank until you select it is worse than no label, so the pass covers them all, sequentially.

Confirmations are held in a session ledger keyed to the loaded source and re-applied after every audioTracks republish. This is load-bearing rather than defensive: the native demuxed-audio path swaps the whole published list when it reconciles against the session, and a disc title switch re-applies the probe-derived lists, so a flag set once at load would have vanished on the user's next audio switch. Keying the ledger to the source also means a session-preserving reload of the same item keeps what the previous pass learned instead of paying for it again.

Live sources are skipped. A second connection to a live origin costs a tuner on some backends, and the pass would start at the live edge rather than at the playhead. Forward-only custom readers are skipped too, since they cannot hand out a second cursor. The side demuxer is markClosed on teardown, so a parked AVIO read cannot outlive the session.

Failure is silent throughout. An unopenable source, a decoder that will not build, a cap hit: all of them just leave the badge off. Nothing throws into the host.

Default is false. A session that does not opt in is unchanged.

Covered by: 1050 tests green across 169 suites, AtmosConfirmationTests new in this release (candidate selection, ledger application across a republish, and the open profile driven against real E-AC-3 media), strict-concurrency clean, macOS plus tvOS and iOS Simulator builds green.