[MPlayer-cvslog] r19670 - trunk/libass/ass_render.c

eugeni subversion at mplayerhq.hu
Mon Sep 4 19:55:57 CEST 2006


Author: eugeni
Date: Mon Sep  4 19:55:57 2006
New Revision: 19670

Modified:
   trunk/libass/ass_render.c

Log:
Add vertical clipping for subtitles that were moved because of a collision.


Modified: trunk/libass/ass_render.c
==============================================================================
--- trunk/libass/ass_render.c	(original)
+++ trunk/libass/ass_render.c	Mon Sep  4 19:55:57 2006
@@ -1943,6 +1943,21 @@
 	ass_image_t* cur = ei->imgs;
 	while (cur) {
 		cur->dst_y += shift;
+		// clip top and bottom
+		if (cur->dst_y < 0) {
+			int clip = - cur->dst_y;
+			cur->h -= clip;
+			cur->bitmap += clip * cur->stride;
+			cur->dst_y = 0;
+		}
+		if (cur->dst_y + cur->h >= frame_context.height) {
+			int clip = cur->dst_y + cur->h - frame_context.height;
+			cur->h -= clip;
+		}
+		if (cur->h <= 0) {
+			cur->h = 0;
+			cur->dst_y = 0;
+		}
 		cur = cur->next;
 	}
 	ei->top += shift;



More information about the MPlayer-cvslog mailing list