1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 15:52:25 +00:00

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:
wm4 2020-05-01 00:59:33 +02:00
parent 008faa3d7f
commit ccbb8b1c9b

View File

@ -640,10 +640,15 @@ function mp.set_osd_ass(res_x, res_y, data)
if not mp._legacy_overlay then if not mp._legacy_overlay then
mp._legacy_overlay = mp.create_osd_overlay("ass-events") mp._legacy_overlay = mp.create_osd_overlay("ass-events")
end end
mp._legacy_overlay.res_x = res_x if mp._legacy_overlay.res_x ~= res_x or
mp._legacy_overlay.res_y = res_y mp._legacy_overlay.res_y ~= res_y or
mp._legacy_overlay.data = data mp._legacy_overlay.data ~= data
mp._legacy_overlay:update() 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 end
function mp.get_osd_size() function mp.get_osd_size()