From ccbb8b1c9b61f0be85b2cff7b3b37b3c88514dda Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 1 May 2020 00:59:33 +0200 Subject: 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.) --- player/lua/defaults.lua | 13 +++++++++---- 1 file 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() -- cgit v1.2.3