opps :)
authorS. Davilla <davilla@4pi.com>
Wed, 2 Oct 2013 15:25:47 +0000 (11:25 -0400)
committerS. Davilla <davilla@4pi.com>
Wed, 2 Oct 2013 15:25:47 +0000 (11:25 -0400)
Revert "gles: fixed crash with nv12 format"

This reverts commit 62a4a657d840e3d83e5a6963c95960293683a95d.

xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp

index 323ff2d..ee437a8 100644 (file)
@@ -1653,7 +1653,7 @@ void CLinuxRendererGLES::DeleteYV12Texture(int index)
   g_graphicsContext.BeginPaint();  //FIXME
   for(int f = 0;f<MAX_FIELDS;f++)
   {
-    for(int p = 0;p<2;p++)
+    for(int p = 0;p<MAX_PLANES;p++)
     {
       if( fields[f][p].id )
       {
@@ -1662,11 +1662,10 @@ void CLinuxRendererGLES::DeleteYV12Texture(int index)
         fields[f][p].id = 0;
       }
     }
-    fields[f][2].id = 0;
   }
   g_graphicsContext.EndPaint();
 
-  for(int p = 0;p<2;p++)
+  for(int p = 0;p<MAX_PLANES;p++)
   {
     if (im.plane[p])
     {
@@ -1703,7 +1702,7 @@ bool CLinuxRendererGLES::CreateYV12Texture(int index)
   glEnable(m_textureTarget);
   for(int f = 0;f<MAX_FIELDS;f++)
   {
-    for(int p = 0;p<2;p++)
+    for(int p = 0;p<MAX_PLANES;p++)
     {
       if (!glIsTexture(fields[f][p].id))
       {
@@ -1711,7 +1710,6 @@ bool CLinuxRendererGLES::CreateYV12Texture(int index)
         VerifyGLState();
       }
     }
-    fields[f][2].id = fields[f][1].id;
   }
 
   // YUV
@@ -1734,8 +1732,8 @@ bool CLinuxRendererGLES::CreateYV12Texture(int index)
     {
       planes[1].texwidth  = planes[0].texwidth  >> im.cshift_x;
       planes[1].texheight = planes[0].texheight >> im.cshift_y;
-      planes[2].texwidth  = planes[1].texwidth;
-      planes[2].texheight = planes[1].texheight;
+      planes[2].texwidth  = planes[0].texwidth  >> im.cshift_x;
+      planes[2].texheight = planes[0].texheight >> im.cshift_y;
     }
 
     if(m_renderMethod & RENDER_POT)