fix(tvos): enable native EAC3 JOC playback

This commit is contained in:
edde746
2026-07-11 12:59:57 +02:00
parent c86d40f8dd
commit e07172ade4
11 changed files with 20 additions and 19 deletions
+1 -1
View File
@@ -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",
+3 -3
View File
@@ -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',
+2 -2
View File
@@ -904,8 +904,8 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> 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));
}
+2 -3
View File
@@ -190,9 +190,8 @@ class _UseExternalPlayerPref extends Pref<bool> {
Future<void> 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<bool> {
const _AudioPassthroughPref() : super('audio_passthrough');
+2 -3
View File
@@ -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());
}
@@ -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"
+1 -1
View File
@@ -947,7 +947,7 @@
repositoryURL = "https://github.com/edde746/MPVKit";
requirement = {
kind = exactVersion;
version = 1.0.9;
version = 1.0.11;
};
};
/* End XCRemoteSwiftPackageReference section */
@@ -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"
}
}
],
@@ -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"
}
}
],
-1
View File
@@ -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)")
}
+1 -1
View File
@@ -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