0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

sub, vo_gl3, vo_vdpau: exit early if there are no sub-images to draw

libass may always return a full change if no subtitle images are
rendered in some cases (empty tracks). Also, a full change despite empty
sub-images list may be reported on initialization. Avoid invoking odd
special cases in the VO code by always exiting early if the sub-image
list is empty.

Note that at least for OSD, the code in sub.c doesn't even send a
request VOCTRL_DRAW_EOSD if the image list is empty. But the subtitle
rendering code in vf_vo.c is independent from this (at least for now).
This commit is contained in:
wm4 2012-10-02 00:25:06 +02:00
parent 252ddcc014
commit 42572fdcc0
2 changed files with 2 additions and 2 deletions

View File

@ -1419,7 +1419,7 @@ static void gen_eosd(struct gl_priv *p, struct osd_render *osd,
osd->num_vertices = 0;
if (imgs->format == SUBBITMAP_EMPTY)
if (imgs->format == SUBBITMAP_EMPTY || imgs->num_parts == 0)
return;
bool need_upload = imgs->bitmap_id != osd->bitmap_id;

View File

@ -997,7 +997,7 @@ static void generate_eosd(struct vo *vo, mp_eosd_images_t *imgs)
sfc->render_count = 0;
if (imgs->format == SUBBITMAP_EMPTY)
if (imgs->format == SUBBITMAP_EMPTY || imgs->num_parts == 0)
return;
if (imgs->bitmap_id == sfc->bitmap_id)