Merge pull request #4518 from astiob/convert_quad
authorjmarshallnz <jcmarsha@gmail.com>
Thu, 17 Apr 2014 01:38:04 +0000 (13:38 +1200)
committerJonathan Marshall <jmarshall@xbmc.org>
Fri, 18 Apr 2014 04:43:10 +0000 (16:43 +1200)
Clean up convert_quad slightly and fix subtitle corruption with new libass

xbmc/cores/VideoRenderers/OverlayRendererUtil.cpp

index 72478ab..ef473e4 100644 (file)
@@ -198,15 +198,15 @@ bool convert_quad(ASS_Image* images, SQuads& quads)
     if((img->color & 0xff) == 0xff || img->w == 0 || img->h == 0)
       continue;
 
-    quads.size_x += img->w;
+    quads.size_x += img->w + 1;
     quads.count++;
   }
 
   if (quads.count == 0)
     return false;
 
-  while(quads.size_x > (int)g_Windowing.GetMaxTextureSize())
-    quads.size_x /= 2;
+  if (quads.size_x > (int)g_Windowing.GetMaxTextureSize())
+    quads.size_x = g_Windowing.GetMaxTextureSize();
 
   int curr_x = 0;
   int curr_y = 0;