Add MPV deinterlace filter setting

Fix #601
This commit is contained in:
Arkadiusz Fal
2024-02-02 09:43:46 +01:00
parent 93ea943c54
commit 5b35c03bc5
5 changed files with 10 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ final class AdvancedSettingsGroupExporter: SettingsGroupExporter {
"mpvEnableLogging": Defaults[.mpvEnableLogging],
"mpvCacheSecs": Defaults[.mpvCacheSecs],
"mpvCachePauseWait": Defaults[.mpvCachePauseWait],
"mpvDeinterlace": Defaults[.mpvDeinterlace],
"showCacheStatus": Defaults[.showCacheStatus],
"feedCacheSize": Defaults[.feedCacheSize]
]

View File

@@ -25,6 +25,10 @@ struct AdvancedSettingsGroupImporter {
Defaults[.mpvCachePauseWait] = mpvCachePauseWait
}
if let mpvDeinterlace = json["mpvDeinterlace"].bool {
Defaults[.mpvDeinterlace] = mpvDeinterlace
}
if let showCacheStatus = json["showCacheStatus"].bool {
Defaults[.showCacheStatus] = showCacheStatus
}

View File

@@ -67,6 +67,7 @@ final class MPVClient: ObservableObject {
checkError(mpv_set_option_string(mpv, "hwdec", machine == "x86_64" ? "no" : "auto-safe"))
checkError(mpv_set_option_string(mpv, "vo", "libmpv"))
checkError(mpv_set_option_string(mpv, "demuxer-lavf-analyzeduration", "1"))
checkError(mpv_set_option_string(mpv, "deinterlace", Defaults[.mpvDeinterlace] ? "yes" : "no"))
checkError(mpv_initialize(mpv))