diff options
author | wm4 <wm4@nowhere> | 2020-05-01 00:59:33 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-05-01 00:59:57 +0200 |
commit | ccbb8b1c9b61f0be85b2cff7b3b37b3c88514dda (patch) | |
tree | cc514b1919eeb9abfbc0b261af65753ecab6a826 /player/lua | |
parent | 008faa3d7fd62c9e8af00281a04ed76db1b41391 (diff) | |
download | mpv-ccbb8b1c9b61f0be85b2cff7b3b37b3c88514dda.tar.bz2 mpv-ccbb8b1c9b61f0be85b2cff7b3b37b3c88514dda.tar.xz |
lua: restore change detection with legacy OSD function
mp.set_osd_ass() (which was undocumented, or in other words, was not
supposed to be used by external scripts) used to do change detection in
the mpv C code. If the resolution or payload did not change, it was not
re-rendered on the lower levels.
Apparently this made some people sad, so fix it. (But only after I told
them to fuck off.) (Well I didn't put it this way, but still.)
Diffstat (limited to 'player/lua')
-rw-r--r-- | player/lua/defaults.lua | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/player/lua/defaults.lua b/player/lua/defaults.lua index 32a6140be4..72920cea67 100644 --- a/player/lua/defaults.lua +++ b/player/lua/defaults.lua @@ -640,10 +640,15 @@ function mp.set_osd_ass(res_x, res_y, data) if not mp._legacy_overlay then mp._legacy_overlay = mp.create_osd_overlay("ass-events") end - mp._legacy_overlay.res_x = res_x - mp._legacy_overlay.res_y = res_y - mp._legacy_overlay.data = data - mp._legacy_overlay:update() + if mp._legacy_overlay.res_x ~= res_x or + mp._legacy_overlay.res_y ~= res_y or + mp._legacy_overlay.data ~= data + then + mp._legacy_overlay.res_x = res_x + mp._legacy_overlay.res_y = res_y + mp._legacy_overlay.data = data + mp._legacy_overlay:update() + end end function mp.get_osd_size() |