Fix mpv subtitles cut off when zoomed in (#166)

* Fix MPV subtitles zoom in

Closes #162
Some .ass subtitles will still be broken due to their forced stylings unless stripped.

* Move everything in a single if statement

Co-authored-by: Jarne Demeulemeester <jarnedemeulemeester@gmail.com>
This commit is contained in:
Yusuf 2022-09-25 16:40:01 +03:00 committed by GitHub
parent 1216322b4a
commit 86ea79b0b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1208,8 +1208,16 @@ class MPVPlayer(
}
fun updateZoomMode(enabled: Boolean) {
val level = if (enabled) "1" else "0"
MPVLib.setOptionString("panscan", level)
if (enabled) {
MPVLib.setOptionString("panscan", "1")
MPVLib.setOptionString("sub-use-margins", "yes")
MPVLib.setOptionString("sub-ass-force-margins", "yes")
}
else {
MPVLib.setOptionString("panscan", "0")
MPVLib.setOptionString("sub-use-margins", "no")
MPVLib.setOptionString("sub-ass-force-margins", "no")
}
}
companion object {