From 7c73f70b8935801760ad465fcc0345c9d59842e6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 7 Sep 2015 14:26:01 +0200 Subject: osd: delay libass initialization as far as possible Until now, most OSD objects created the associated ASS_Renderer instance as soon as possible, even if nothing was going to be rendered. Maybe this was even intentional. Change this for the sake of lowering resource usage, and strictly initialize ASS_Renderer only when it's really needed. For the OSC, initialization has to be forced, because of the insane mechanism for translating mouse coordinates to OSD coordinates. --- player/lua.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'player/lua.c') diff --git a/player/lua.c b/player/lua.c index cf0c5caa41..3bf5298578 100644 --- a/player/lua.c +++ b/player/lua.c @@ -967,6 +967,8 @@ static int script_set_osd_ass(lua_State *L) int res_x = luaL_checkinteger(L, 1); int res_y = luaL_checkinteger(L, 2); const char *text = luaL_checkstring(L, 3); + if (!text[0]) + text = " "; // force external OSD initialization osd_set_external(mpctx->osd, res_x, res_y, (char *)text); mp_input_wakeup(mpctx->input); return 0; -- cgit v1.2.3