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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user