diff --git a/macos/Runner/MpvPlayer/MpvPlayerCore.swift b/macos/Runner/MpvPlayer/MpvPlayerCore.swift index 32404c5f..7f619642 100644 --- a/macos/Runner/MpvPlayer/MpvPlayerCore.swift +++ b/macos/Runner/MpvPlayer/MpvPlayerCore.swift @@ -102,7 +102,21 @@ class MpvPlayerCore: MpvPlayerCoreBase { } override func configurePlatformMpvOptions(mpv: OpaquePointer) { + // AVFoundation stays the macOS output. Spatialization is only reachable + // through the AVFoundation renderer — allowedAudioSpatializationFormats is a + // property of AVSampleBufferAudioRenderer (macOS 12+), and the AO opts + // compressed playback into the multichannel format — and the E-AC3 JOC sink + // lives there too. CoreAudio writes straight to the HAL device and exposes no + // spatialization control at all, so it is a fallback, not an alternative. checkError(mpv_set_option_string(mpv, "ao", "avfoundation,coreaudio")) + // Unbound the AO's PCM lookahead, restoring the renderer-owned queue depth + // 2.9.1 shipped (#1711). The macOS-only 0.5s bound MPVKit 1.0.15 added is the + // only change to this path between 2.9.1 and 2.10, and 2.10 skips audio at + // roughly that cadence. Its purpose was making mpv's software --volume, which + // is baked into the samples handed to the AO, audible before the queue + // drains; that latency is back, and belongs to the AO's gain domain rather + // than to how far ahead it may buffer. + checkError(mpv_set_option_string(mpv, "ao-avfoundation-max-lookahead", "0")) } func reattachMetalLayer() {