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

@@ -902,6 +902,12 @@ final class MPVBackend: PlayerBackend {
mpvClient?.updateSubtitleSettings()
}
/// Push the current tvOS audio-delay setting into the running MPV instance.
/// Caller passes milliseconds; MPVClient converts to seconds.
func updateAudioDelay(milliseconds: Double) {
mpvClient?.updateAudioDelay(milliseconds: milliseconds)
}
/// Get the actual video track dimensions from MPV.
/// Returns (width, height) or nil if not available.
func getVideoSize() -> (width: Int, height: Int)? {
@@ -963,6 +969,14 @@ final class MPVBackend: PlayerBackend {
stats.audioSpeedCorrection = props.audioSpeedCorrection
stats.framedrop = props.framedrop
stats.displayLinkFps = renderView?.displayLinkTargetFPS
stats.audioDelay = props.audioDelay
stats.currentVo = props.currentVo
stats.currentAo = props.currentAo
stats.audioDevice = props.audioDevice
stats.displayWidth = props.displayWidth
stats.displayHeight = props.displayHeight
stats.displayNames = props.displayNames
stats.decoderFrameDropCount = props.decoderFrameDropCount
#endif
return stats