diff options
author | wm4 <wm4@nowhere> | 2020-01-08 00:16:58 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-01-08 00:16:58 +0100 |
commit | 11b9315b3fce4de1fae799d4609c66029d8cc914 (patch) | |
tree | dd91767bdabd7498ecc1a5665fa9c8b9f68942dd /player/lua | |
parent | db9048f21aa955dbd7176d4e8d7245297e97177b (diff) | |
download | mpv-11b9315b3fce4de1fae799d4609c66029d8cc914.tar.bz2 mpv-11b9315b3fce4de1fae799d4609c66029d8cc914.tar.xz |
lua: use new OSD property
See previous commit.
A nice side-effect is that mp.get_osd_margins() is not a special
Lua-only thing anymore. I didn't test whether this function still works
as expected, though.
Diffstat (limited to 'player/lua')
-rw-r--r-- | player/lua/defaults.lua | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/player/lua/defaults.lua b/player/lua/defaults.lua index f44d004a99..7681ca173e 100644 --- a/player/lua/defaults.lua +++ b/player/lua/defaults.lua @@ -638,17 +638,14 @@ function mp.set_osd_ass(res_x, res_y, data) end function mp.get_osd_size() - local w = mp.get_property_number("osd-width", 0) - local h = mp.get_property_number("osd-height", 0) - local par = mp.get_property_number("osd-par", 0) - if par == 0 then - par = 1 - end - - local aspect = 1.0 * w / math.max(h, 1.0) / par - return w, h, aspect + local prop = mp.get_property_native("osd-dimensions") + return prop.w, prop.h, prop.aspect end +function mp.get_osd_margins() + local prop = mp.get_property_native("osd-dimensions") + return prop.ml, prop.mt, prop.mr, prop.mb +end local mp_utils = package.loaded["mp.utils"] |