diff --git a/lib/i18n/en.i18n.json b/lib/i18n/en.i18n.json index 23836ed2..0a5e5bd9 100644 --- a/lib/i18n/en.i18n.json +++ b/lib/i18n/en.i18n.json @@ -271,7 +271,7 @@ "tunneledPlaybackDescription": "Use video tunneling. Disable if HDR playback shows black video.", "audioPassthrough": "Audio Passthrough", "audioPassthroughDescription": "Send Dolby/DTS audio to your receiver or TV without re-encoding, preserving surround sound. Turn off if you have no sound.", - "audioPassthroughDescriptionAppleTv": "Hand Dolby Digital Plus (including Atmos) to the system for bitstream output. DTS and TrueHD still play as multichannel PCM. Brief audio gaps can occur when seeking.", + "audioPassthroughDescriptionAppleTv": "Use Apple's native Dolby decoder for Dolby Digital Plus, including Atmos. DTS and TrueHD still play as multichannel PCM. Turn off if you have no sound.", "audioDownmix": "Downmix to Stereo", "audioDownmixDescription": "Mix surround audio down to two channels for stereo speakers or headphones", "downmixCenterBoost": "Center Channel Boost", diff --git a/lib/i18n/strings_en.g.dart b/lib/i18n/strings_en.g.dart index 05cf3110..fdebdf9c 100644 --- a/lib/i18n/strings_en.g.dart +++ b/lib/i18n/strings_en.g.dart @@ -927,8 +927,8 @@ class TranslationsSettingsEn { /// en: 'Send Dolby/DTS audio to your receiver or TV without re-encoding, preserving surround sound. Turn off if you have no sound.' String get audioPassthroughDescription => 'Send Dolby/DTS audio to your receiver or TV without re-encoding, preserving surround sound. Turn off if you have no sound.'; - /// en: 'Hand Dolby Digital Plus (including Atmos) to the system for bitstream output. DTS and TrueHD still play as multichannel PCM. Brief audio gaps can occur when seeking.' - String get audioPassthroughDescriptionAppleTv => 'Hand Dolby Digital Plus (including Atmos) to the system for bitstream output. DTS and TrueHD still play as multichannel PCM. Brief audio gaps can occur when seeking.'; + /// en: 'Use Apple's native Dolby decoder for Dolby Digital Plus, including Atmos. DTS and TrueHD still play as multichannel PCM. Turn off if you have no sound.' + String get audioPassthroughDescriptionAppleTv => 'Use Apple\'s native Dolby decoder for Dolby Digital Plus, including Atmos. DTS and TrueHD still play as multichannel PCM. Turn off if you have no sound.'; /// en: 'Downmix to Stereo' String get audioDownmix => 'Downmix to Stereo'; @@ -5224,7 +5224,7 @@ extension on Translations { 'settings.tunneledPlaybackDescription' => 'Use video tunneling. Disable if HDR playback shows black video.', 'settings.audioPassthrough' => 'Audio Passthrough', 'settings.audioPassthroughDescription' => 'Send Dolby/DTS audio to your receiver or TV without re-encoding, preserving surround sound. Turn off if you have no sound.', - 'settings.audioPassthroughDescriptionAppleTv' => 'Hand Dolby Digital Plus (including Atmos) to the system for bitstream output. DTS and TrueHD still play as multichannel PCM. Brief audio gaps can occur when seeking.', + 'settings.audioPassthroughDescriptionAppleTv' => 'Use Apple\'s native Dolby decoder for Dolby Digital Plus, including Atmos. DTS and TrueHD still play as multichannel PCM. Turn off if you have no sound.', 'settings.audioDownmix' => 'Downmix to Stereo', 'settings.audioDownmixDescription' => 'Mix surround audio down to two channels for stereo speakers or headphones', 'settings.downmixCenterBoost' => 'Center Channel Boost', diff --git a/lib/screens/video_player_screen.dart b/lib/screens/video_player_screen.dart index 8118ff79..cb1e5b83 100644 --- a/lib/screens/video_player_screen.dart +++ b/lib/screens/video_player_screen.dart @@ -904,8 +904,8 @@ class VideoPlayerScreenState extends State with WidgetsBindin ); } - // Audio passthrough (desktop, Android TV, and Apple TV — where the - // fork's AVPlayer Atmos sink handles EAC3+JOC, #1300) + // Audio passthrough (desktop, Android TV, and Apple TV, where the native + // sample-buffer renderer handles AC3/EAC3, including JOC metadata). if (PlatformDetector.supportsAudioPassthrough()) { await currentPlayer.setAudioPassthrough(settingsService.read(SettingsService.audioPassthrough)); } diff --git a/lib/services/settings_service.dart b/lib/services/settings_service.dart index 1ab54e54..921b9e63 100644 --- a/lib/services/settings_service.dart +++ b/lib/services/settings_service.dart @@ -190,9 +190,8 @@ class _UseExternalPlayerPref extends Pref { Future writeTo(BaseSharedPreferencesService svc, bool value) => svc.writeBool(key, value); } -/// Experimental Dolby passthrough. Keep opt-in on Apple TV until the -/// AVPlayer Atmos sink (EAC3+JOC → Dolby MAT, #1300) is verified on real -/// receiver setups; non-JOC content still decodes to multichannel PCM there. +/// Experimental native Dolby playback. Keep opt-in on Apple TV until the +/// EAC3+JOC sample-buffer renderer (#1300) is verified on real receivers. class _AudioPassthroughPref extends Pref { const _AudioPassthroughPref() : super('audio_passthrough'); diff --git a/lib/utils/platform_detector.dart b/lib/utils/platform_detector.dart index bcb7ff60..45f7bb00 100644 --- a/lib/utils/platform_detector.dart +++ b/lib/utils/platform_detector.dart @@ -220,9 +220,8 @@ class PlatformDetector { } static bool supportsAudioPassthrough() { - // Apple TV: EAC3+JOC rides the AVPlayer Atmos sink in the mpv fork's - // ao_avfoundation; other Dolby content decodes to multichannel PCM. - // Route capability is gated at runtime inside the AO itself. + // Apple TV hands AC3/EAC3 access units to the native sample-buffer audio + // renderer; unsupported streams and renderer failures fall back to PCM. return isAppleTV() || isDesktopOS() || (Platform.isAndroid && isTV()); } diff --git a/shared/apple/AtmosProbe/AtmosProbePlugin.swift b/shared/apple/AtmosProbe/AtmosProbePlugin.swift index aa375aa6..8f304c2b 100644 --- a/shared/apple/AtmosProbe/AtmosProbePlugin.swift +++ b/shared/apple/AtmosProbe/AtmosProbePlugin.swift @@ -101,6 +101,10 @@ public class AtmosProbePlugin: NSObject, FlutterPlugin { out["route"] = session.currentRoute.outputs.map { port in "\(port.portType.rawValue)/\(port.portName)/\(port.channels?.count ?? 0)ch" }.joined(separator: ", ") + if #available(iOS 17.2, tvOS 17.2, *) { + out["renderingMode"] = String(describing: session.renderingMode) + out["renderingModeRawValue"] = session.renderingMode.rawValue + } guard let player = player else { out["state"] = "idle" diff --git a/tvos/Runner.xcodeproj/project.pbxproj b/tvos/Runner.xcodeproj/project.pbxproj index 88b7fda7..131620c3 100644 --- a/tvos/Runner.xcodeproj/project.pbxproj +++ b/tvos/Runner.xcodeproj/project.pbxproj @@ -947,7 +947,7 @@ repositoryURL = "https://github.com/edde746/MPVKit"; requirement = { kind = exactVersion; - version = 1.0.9; + version = 1.0.11; }; }; /* 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 index 7327bc8d..eda4b805 100644 --- a/tvos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/tvos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/edde746/MPVKit", "state" : { - "revision" : "206ba4a9f8f8191f18cabfdc025bfa512729af58", - "version" : "1.0.9" + "revision" : "8c10cb56744fe424f3ee1c0753388b0c6dd2dbc9", + "version" : "1.0.11" } } ], diff --git a/tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved index 7327bc8d..eda4b805 100644 --- a/tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/edde746/MPVKit", "state" : { - "revision" : "206ba4a9f8f8191f18cabfdc025bfa512729af58", - "version" : "1.0.9" + "revision" : "8c10cb56744fe424f3ee1c0753388b0c6dd2dbc9", + "version" : "1.0.11" } } ], diff --git a/tvos/Runner/AppDelegate.swift b/tvos/Runner/AppDelegate.swift index 0eee747b..272a2b44 100644 --- a/tvos/Runner/AppDelegate.swift +++ b/tvos/Runner/AppDelegate.swift @@ -121,7 +121,6 @@ import wakelock_plus do { let session = AVAudioSession.sharedInstance() try session.setCategory(.playback, mode: .default) - try session.setActive(true) } catch { print("Failed to configure audio session: \(error)") } diff --git a/tvos/scripts/wire_mpv.rb b/tvos/scripts/wire_mpv.rb index 7949d40f..3f27156d 100755 --- a/tvos/scripts/wire_mpv.rb +++ b/tvos/scripts/wire_mpv.rb @@ -42,7 +42,7 @@ end # Swift Package: MPVKit. pkg_url = 'https://github.com/edde746/MPVKit' -pkg_version = '1.0.8' +pkg_version = '1.0.11' existing_pkg = project.root_object.package_references.find do |p| p.repositoryURL == pkg_url rescue false end