diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index f65af058..74c75cf3 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -789,7 +789,7 @@ repositoryURL = "https://github.com/edde746/MPVKit"; requirement = { kind = revision; - revision = 1fc33029bc0317583866c62811dc0ab2aa2415b6; + revision = 1fe345d46bac91f4e85239ad268430e037040b2b; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index dae38a86..42fd6d7f 100644 --- a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -40,7 +40,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/edde746/MPVKit", "state" : { - "revision" : "1fc33029bc0317583866c62811dc0ab2aa2415b6" + "revision" : "1fe345d46bac91f4e85239ad268430e037040b2b" } }, { diff --git a/lib/screens/video_player_screen.dart b/lib/screens/video_player_screen.dart index 971a3a7c..18e0dce0 100644 --- a/lib/screens/video_player_screen.dart +++ b/lib/screens/video_player_screen.dart @@ -808,8 +808,9 @@ class VideoPlayerScreenState extends State with WidgetsBindin ); } - // Audio passthrough (desktop only - sends bitstream to receiver) - if (PlatformDetector.isDesktopOS()) { + // Audio passthrough (desktop bitstreams to the receiver; Apple TV + // hands compressed AC3/EAC3 to the system for Dolby/Atmos output) + if (PlatformDetector.isDesktopOS() || PlatformDetector.isAppleTV()) { if (settingsService.read(SettingsService.audioPassthrough)) { await currentPlayer.setAudioPassthrough(true); } diff --git a/lib/services/settings_service.dart b/lib/services/settings_service.dart index b547e154..f89b888e 100644 --- a/lib/services/settings_service.dart +++ b/lib/services/settings_service.dart @@ -169,6 +169,20 @@ class _UseExternalPlayerPref extends Pref { Future 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 { + const _AudioPassthroughPref() : super('audio_passthrough'); + + @override + bool readFrom(BaseSharedPreferencesService svc) { + return svc.prefs.getBool(key) ?? PlatformDetector.isAppleTV(); + } + + @override + Future 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'); diff --git a/lib/widgets/video_controls/sheets/video_settings_sheet.dart b/lib/widgets/video_controls/sheets/video_settings_sheet.dart index c56eaeac..018fcc74 100644 --- a/lib/widgets/video_controls/sheets/video_settings_sheet.dart +++ b/lib/widgets/video_controls/sheets/video_settings_sheet.dart @@ -547,8 +547,8 @@ class _VideoSettingsSheetState extends State { }, ), - // Audio Passthrough (Desktop only) - if (isDesktop) + // Audio Passthrough (desktop and Apple TV) + if (PlatformDetector.isDesktopOS() || PlatformDetector.isAppleTV()) _SettingsToggleItem( pref: SettingsService.audioPassthrough, icon: Symbols.surround_sound_rounded, diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 9d806532..a1ad0632 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -883,7 +883,7 @@ repositoryURL = "https://github.com/edde746/MPVKit"; requirement = { kind = revision; - revision = 1fc33029bc0317583866c62811dc0ab2aa2415b6; + revision = 1fe345d46bac91f4e85239ad268430e037040b2b; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/pubspec.yaml b/pubspec.yaml index f0b2c83c..69c05069 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: plezy description: "A beautiful Plex and Jellyfin client for Flutter" publish_to: "none" -version: 2.6.0+112 +version: 2.6.1+114 environment: sdk: ">=3.12.0 <4.0.0" diff --git a/shared/apple/MpvPlayer/MpvPlayerCoreBase.swift b/shared/apple/MpvPlayer/MpvPlayerCoreBase.swift index 736bc41e..5fbfb4e9 100644 --- a/shared/apple/MpvPlayer/MpvPlayerCoreBase.swift +++ b/shared/apple/MpvPlayer/MpvPlayerCoreBase.swift @@ -352,11 +352,10 @@ class MpvPlayerCoreBase: NSObject { return false } - #if DEBUG - checkError(mpv_request_log_messages(mpv, "info")) - #else - checkError(mpv_request_log_messages(mpv, "warn")) - #endif + // TEMP: always "v" (tvOS builds in release) so the avfoundation VO's + // osd-perf timing lines show up — restore the DEBUG/warn split after the + // subtitle-timing investigation. + checkError(mpv_request_log_messages(mpv, "v")) var layer = Int64(Int(bitPattern: Unmanaged.passUnretained(renderLayer).toOpaque())) checkError(mpv_set_option(mpv, "wid", MPV_FORMAT_INT64, &layer)) diff --git a/tvos/Runner.xcodeproj/project.pbxproj b/tvos/Runner.xcodeproj/project.pbxproj index 9f4f4626..dedb76fb 100644 --- a/tvos/Runner.xcodeproj/project.pbxproj +++ b/tvos/Runner.xcodeproj/project.pbxproj @@ -933,7 +933,7 @@ repositoryURL = "https://github.com/edde746/MPVKit"; requirement = { kind = revision; - revision = 1fc33029bc0317583866c62811dc0ab2aa2415b6; + revision = 1fe345d46bac91f4e85239ad268430e037040b2b; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/tvos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/tvos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index 661770df..00000000 --- a/tvos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,14 +0,0 @@ -{ - "originHash" : "c535d3cdb62bd4e11e67f3c9e68290fa7ee9306634c5f56d2b0396eb75ed41ee", - "pins" : [ - { - "identity" : "mpvkit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/edde746/MPVKit", - "state" : { - "revision" : "1fc33029bc0317583866c62811dc0ab2aa2415b6" - } - } - ], - "version" : 3 -} diff --git a/tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved index 661770df..643b4a29 100644 --- a/tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,7 +6,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/edde746/MPVKit", "state" : { - "revision" : "1fc33029bc0317583866c62811dc0ab2aa2415b6" + "revision" : "1fe345d46bac91f4e85239ad268430e037040b2b" } } ],