mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
osd_libass: avoid libass warnings if scripts set ASS text early
Lua scripts can call osd_set_external() early (before the VO window is created and obj->vo_res is filled), in which case the PlayResX field would be set to nonsense, and libass would print a pointless warning. There's an easy and a hard fix: either just go on and pass dummy values to libass (basically like before, just clamp them to avoid the values which make libass print the warning). Or attempt to update the PlayRes field to correct values on rendering (since at rendering time, you always know the screen size and the correct values). Do the latter. Since various things use PlayRes for scaling things, this might still not be fully ideal. This is a general problem with the async scripting interface.
This commit is contained in:
@@ -22,6 +22,7 @@ struct ass_state {
|
||||
struct ass_track *track;
|
||||
struct ass_renderer *render;
|
||||
struct ass_library *library;
|
||||
int res_x, res_y;
|
||||
};
|
||||
|
||||
struct osd_object {
|
||||
|
||||
Reference in New Issue
Block a user