Add tvOS A/V sync diagnostics on its own settings page

Surface audio-delay (±10/±100 ms) and video-sync-mode controls behind an
"A/V Sync" navigation row in Advanced settings rather than inline, keeping the
Advanced page uncluttered. Audio delay applies live to the running MPV
instance; sync mode takes effect on next playback.
This commit is contained in:
Arkadiusz Fal
2026-05-14 09:43:25 +02:00
parent 579df26284
commit c168fbae02
11 changed files with 494 additions and 2 deletions

View File

@@ -32,6 +32,9 @@ struct AdvancedSettingsView: View {
#endif
streamDetailsSection
mpvSection
#if os(tvOS)
avSyncSection
#endif
settingsSection
#if !os(tvOS)
downloadsStorageSection
@@ -230,6 +233,26 @@ struct AdvancedSettingsView: View {
}
}
#if os(tvOS)
@ViewBuilder
private var avSyncSection: some View {
if let settings = appEnvironment?.settingsManager {
SettingsFormSection {
NavigationLink {
TVSidebarDetailContainer(
systemImage: "wave.3.right",
title: String(localized: "settings.playback.tvSyncDiagnostics.header")
) {
AVSyncDiagnosticsView(settings: settings)
}
} label: {
Label(String(localized: "settings.playback.tvSyncDiagnostics.row"), systemImage: "wave.3.right")
}
}
}
}
#endif
private static let mpvBufferOptions: [Double] = [1.0, 2.0, 3.0, 4.0, 5.0]
private func formatBufferOption(_ seconds: Double) -> String {