feat(tvos): AVPlayer Atmos sink wiring + Atmos output diagnostics

Re-enables Audio Passthrough on Apple TV against the MPVKit EAC3-JOC
AVPlayer sink (pin bump to v1.0.8 follows), adds an AVPlayer test
harness + diagnostics screen for #1300, and makes loudnorm yield while
passthrough is active (fixes a latent spdif conflict on desktop too).
This commit is contained in:
edde746
2026-07-02 15:52:10 +02:00
parent 86abf3e9da
commit 6d95e35448
46 changed files with 1408 additions and 73 deletions
+16
View File
@@ -363,6 +363,7 @@ class PlayerNative extends PlayerBase {
bool _passthroughRequested = false;
bool _passthroughActive = false;
bool _normalizationRequested = false;
double _currentRate = 1.0;
@override
@@ -383,6 +384,11 @@ class PlayerNative extends PlayerBase {
Future<void> _applyPassthrough(bool enabled) async {
_passthroughActive = enabled;
// loudnorm decodes to PCM, which defeats bitstream passthrough; the
// filter yields while passthrough is active and returns when it ends.
if (enabled && _normalizationRequested) {
await super.setAudioNormalization(false);
}
await setProperty('audio-spdif', enabled ? _passthroughCodecs : '');
// audio-exclusive redirects coreaudio to coreaudio_exclusive on macOS
// (and exclusive WASAPI on Windows); on iOS/tvOS it is set once at
@@ -390,6 +396,16 @@ class PlayerNative extends PlayerBase {
if (!Platform.isIOS) {
await setProperty('audio-exclusive', enabled ? 'yes' : 'no');
}
if (!enabled && _normalizationRequested) {
await super.setAudioNormalization(true);
}
}
@override
Future<void> setAudioNormalization(bool enabled) async {
_normalizationRequested = enabled;
if (enabled && _passthroughActive) return; // deferred until passthrough ends
await super.setAudioNormalization(enabled);
}
@override