mirror of https://github.com/mpv-player/mpv
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.)
This commit is contained in:
parent
008faa3d7f
commit
ccbb8b1c9b
|
@ -640,11 +640,16 @@ 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
|
||||
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()
|
||||
local prop = mp.get_property_native("osd-dimensions")
|
||||
|
|
Loading…
Reference in New Issue