mirror of
https://github.com/mpv-player/mpv
synced 2024-11-03 03:19:24 +01:00
9bb03b7db4
To draw libass subtitles, the code used ASS_Renderer objects created in vf_vo (VO rendering) or vf_ass. They were destroyed and recreated together with the video filter chain. Change the code to use a single persistent renderer instance stored in the main osd_state struct. Because libass seems to misbehave if fonts are changed while a renderer exists (even if ass_set_fonts() is called on the renderer afterwards), the renderer is recreated after adding embedded fonts. The known benefits are simpler code and avoiding delays when switching between timeline parts from different files (libass fontconfig initialization, needed when creating a new renderer, can take a long time in some cases; switching between files rebuilds the video filter chain, and this required recreating the renderers). On the other hand, I'm not sure whether this could cause inefficient bitmap caching in libass; explicitly resetting the renderer in some cases could be beneficial. The new code does not keep the distinction of separate renderers for vsfilter munged aspect vs normal; this means that changing subtitle tracks can lose cache for the previous track. The new code always sets some libass parameters on each rendering call, which were previously only set if they had potentially changed. This should be harmless as libass itself has checks to see if the values differ from previous ones. Conflicts: command.c libmpcodecs/vf_ass.c libmpcodecs/vf_vo.c mplayer.c sub/ass_mp.c |
||
---|---|---|
.. | ||
aspect.c | ||
aspect.h | ||
cocoa_common.h | ||
cocoa_common.m | ||
csputils.c | ||
csputils.h | ||
d3d_shader_yuv_2ch.h | ||
d3d_shader_yuv.h | ||
d3d_shader_yuv.hlsl | ||
eosd_packer.c | ||
eosd_packer.h | ||
fastmemcpy.h | ||
filter_kernels.c | ||
filter_kernels.h | ||
geometry.c | ||
geometry.h | ||
gl_common.c | ||
gl_common.h | ||
gl_header_fixes.h | ||
osd_template.c | ||
osd.c | ||
osd.h | ||
osx_common.c | ||
osx_common.h | ||
video_out.c | ||
video_out.h | ||
vo_caca.c | ||
vo_corevideo.h | ||
vo_corevideo.m | ||
vo_direct3d.c | ||
vo_gl3_shaders.glsl | ||
vo_gl3.c | ||
vo_gl.c | ||
vo_image.c | ||
vo_null.c | ||
vo_vdpau.c | ||
vo_x11.c | ||
vo_xv.c | ||
w32_common.c | ||
w32_common.h | ||
x11_common.c | ||
x11_common.h |