fix: Use VideoToolbox for iOS MPV hardware decoding

This commit is contained in:
Luqman Fadlli 2026-06-06 01:56:29 +07:00 committed by GitHub
parent 99ce529a78
commit 396e9dae3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -317,7 +317,7 @@ final class MPVPlayerViewController: UIViewController {
checkError(mpv_set_option_string(mpv, "vo", "gpu-next"))
checkError(mpv_set_option_string(mpv, "gpu-api", "vulkan"))
checkError(mpv_set_option_string(mpv, "gpu-context", "moltenvk"))
checkError(mpv_set_option_string(mpv, "hwdec", "auto"))
checkError(mpv_set_option_string(mpv, "hwdec", "videotoolbox"))
checkError(mpv_set_option_string(mpv, "audio-channels", "stereo"))
checkError(mpv_set_option_string(mpv, "audio-fallback-to-null", "yes"))
checkError(mpv_set_option_string(mpv, "vulkan-swap-mode", "fifo"))
@ -498,7 +498,7 @@ final class MPVPlayerViewController: UIViewController {
metalLayer.wantsExtendedDynamicRangeContent = extendedDynamicRange
guard mpv != nil else { return }
setStringProperty("hwdec", hardwareDecoder)
setStringProperty("hwdec", "videotoolbox")
setStringProperty("target-colorspace-hint", targetColorspaceHint ? "yes" : "no")
setStringProperty("tone-mapping", toneMapping)
setStringProperty("hdr-compute-peak", hdrComputePeak ? "yes" : "no")