changeset 21364:d81ffbf9615f

EMISSINGBRAIN: No, OSD objects of size 0 sure are _not_ visible. Fixes massive slowdown after adding dvdnav highlight support, at least with -vo xvmc, potentially others too.
author reimar
date Wed, 29 Nov 2006 11:57:16 +0000
parents 8618755f2c06
children fef7a6713be2
files libvo/sub.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/sub.c	Wed Nov 29 11:07:30 2006 +0000
+++ b/libvo/sub.c	Wed Nov 29 11:57:16 2006 +0000
@@ -221,7 +221,9 @@
   len = obj->stride * (obj->bbox.y2 - obj->bbox.y1);
   memset (obj->bitmap_buffer, OSD_NAV_BOX_ALPHA, len);
   memset (obj->alpha_buffer, OSD_NAV_BOX_ALPHA, len);
-  obj->flags |= OSDFLAG_BBOX | OSDFLAG_VISIBLE | OSDFLAG_CHANGED;
+  obj->flags |= OSDFLAG_BBOX | OSDFLAG_CHANGED;
+  if (obj->bbox.y2 > obj->bbox.y1 && obj->bbox.x2 > obj->bbox.x1)
+    obj->flags |= OSDFLAG_VISIBLE;
 }
 #endif
 
@@ -1003,7 +1005,9 @@
     while(obj){
 	if(obj->flags&OSDFLAG_VISIBLE){
 	    if(	(obj->bbox.x1<=x2 && obj->bbox.x2>=x1) &&
-		(obj->bbox.y1<=y2 && obj->bbox.y2>=y1) ) return 1;
+		(obj->bbox.y1<=y2 && obj->bbox.y2>=y1) &&
+		obj->bbox.y2 > obj->bbox.y1 && obj->bbox.x1 > obj->bbox.x2
+		) return 1;
 	}
 	obj=obj->next;
     }