From 51befc9debef818cbf071aebf8861457ac095f8d Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 18 Mar 2015 12:33:14 +0100 Subject: 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. --- sub/ass_mp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sub/ass_mp.c') diff --git a/sub/ass_mp.c b/sub/ass_mp.c index 44ce330d0e..a02ff8d632 100644 --- a/sub/ass_mp.c +++ b/sub/ass_mp.c @@ -134,10 +134,8 @@ void mp_ass_render_frame(ASS_Renderer *renderer, ASS_Track *track, double time, { int changed; ASS_Image *imgs = ass_render_frame(renderer, track, time, &changed); - if (changed == 2) - res->bitmap_id = ++res->bitmap_pos_id; - else if (changed) - res->bitmap_pos_id++; + if (changed) + res->change_id++; res->format = SUBBITMAP_LIBASS; res->parts = *parts; -- cgit v1.2.3