fix(tvos): update mpvkit audio passthrough

This commit is contained in:
edde746
2026-06-13 10:24:15 +02:00
parent 4f422f1485
commit 3c43874342
11 changed files with 30 additions and 30 deletions
+15 -1
View File
@@ -169,6 +169,20 @@ class _UseExternalPlayerPref extends Pref<bool> {
Future<void> writeTo(BaseSharedPreferencesService svc, bool value) => svc.writeBool(key, value);
}
/// Defaults to on for Apple TV, where passthrough is what gets Dolby Digital
/// (Plus) / Atmos to the receiver; opt-in everywhere else.
class _AudioPassthroughPref extends Pref<bool> {
const _AudioPassthroughPref() : super('audio_passthrough');
@override
bool readFrom(BaseSharedPreferencesService svc) {
return svc.prefs.getBool(key) ?? PlatformDetector.isAppleTV();
}
@override
Future<void> writeTo(BaseSharedPreferencesService svc, bool value) => svc.writeBool(key, value);
}
String? _trimEmptyAsNull(String? v) {
final t = v?.trim();
return (t == null || t.isEmpty) ? null : t;
@@ -393,7 +407,7 @@ class SettingsService extends BaseSharedPreferencesService {
defaultValue: VisualEffectsSetting.auto,
);
static const ambientLighting = BoolPref('ambient_lighting');
static const audioPassthrough = BoolPref('audio_passthrough');
static const audioPassthrough = _AudioPassthroughPref();
static const audioNormalization = BoolPref('audio_normalization');
static const liveTvDefaultFavorites = BoolPref('live_tv_default_favorites');
static const matchRefreshRate = BoolPref('match_refresh_rate');