diff options
author | wm4 <wm4@nowhere> | 2015-03-18 12:33:14 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-03-18 13:15:20 +0100 |
commit | 51befc9debef818cbf071aebf8861457ac095f8d (patch) | |
tree | 140152a3b5db9655c5b869d83a7d0c6212c91a6a /video/out/vo_wayland.c | |
parent | 15478ca31c48d46b576264299803ab43fdeb1d04 (diff) | |
download | mpv-51befc9debef818cbf071aebf8861457ac095f8d.tar.bz2 mpv-51befc9debef818cbf071aebf8861457ac095f8d.tar.xz |
osd: simplify an aspect of change detection handling
There was a somewhat obscure optimization in the OSD and subtitle
rendering path: if only the position of the sub-images changed, and not
the actual image data, uploading of the image data could be skipped. In
theory, this could speed up things like scrolling subtitles.
But it turns out that even in the rare cases subtitles have such scrolls
or axis-aligned movement, modern libass rarely signals this kind of
change. Possibly this is because of sub-pixel handling and such, which
break this.
As such, it's a worthless optimization and just introduces additional
complexity and subtle bugs (especially in cases libass does the
opposite: incorrectly signaling a position change only, which happened
before). Remove this optimization, and rename bitmap_pos_id to
change_id.
Diffstat (limited to 'video/out/vo_wayland.c')
-rw-r--r-- | video/out/vo_wayland.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c index 9da24ddf3e..c179bbe179 100644 --- a/video/out/vo_wayland.c +++ b/video/out/vo_wayland.c @@ -134,7 +134,7 @@ struct priv { struct wl_subsurface *osd_subsurfaces[MAX_OSD_PARTS]; shm_buffer_t *osd_buffers[MAX_OSD_PARTS]; // this id tells us if the subtitle part has changed or not - int bitmap_pos_id[MAX_OSD_PARTS]; + int change_id[MAX_OSD_PARTS]; int64_t recent_flip_time; // last frame event @@ -455,8 +455,8 @@ static void draw_osd_cb(void *ctx, struct sub_bitmaps *imgs) struct wl_surface *s = p->osd_surfaces[id]; - if (imgs->bitmap_pos_id != p->bitmap_pos_id[id]) { - p->bitmap_pos_id[id] = imgs->bitmap_pos_id; + if (imgs->change_id != p->change_id[id]) { + p->change_id[id] = imgs->change_id; struct mp_rect bb; if (!mp_sub_bitmaps_bb(imgs, &bb)) |