summaryrefslogtreecommitdiffstats
path: root/sub/osd_state.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-07-16 13:33:19 +0200
committerwm4 <wm4@nowhere>2017-07-16 13:33:19 +0200
commit572802e8664a344481682990db1458f13eb6b9eb (patch)
tree8ea2686e123ccfcd0557d1e83a05e938631c152a /sub/osd_state.h
parentddd068491c9e8f7f77b6bba61269f867bdad204b (diff)
downloadmpv-572802e8664a344481682990db1458f13eb6b9eb.tar.bz2
mpv-572802e8664a344481682990db1458f13eb6b9eb.tar.xz
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.
Diffstat (limited to 'sub/osd_state.h')
-rw-r--r--sub/osd_state.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sub/osd_state.h b/sub/osd_state.h
index dc2d6d5b6c..5cb0f1e07c 100644
--- a/sub/osd_state.h
+++ b/sub/osd_state.h
@@ -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 {