diff src/video/photon/SDL_phyuv.c @ 1289:c07c6ef7c93e

Date: Fri, 18 Feb 2005 07:58:00 +0200 From: "Mike Gorchak" Subject: [SDL] [PATCH] QNX6 and not only QNX6 fixes 1) Update SDL.qpg.in for the QNX 6.3. 4) video/photon/SDL_phyuv.c - fixed bug with swapped U and V planes, using YV12 mode with radeon cards.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 29 Jan 2006 09:19:55 +0000
parents 05c551e5bc64
children c9b51268668f
line wrap: on
line diff
--- a/src/video/photon/SDL_phyuv.c	Sun Jan 29 09:13:36 2006 +0000
+++ b/src/video/photon/SDL_phyuv.c	Sun Jan 29 09:19:55 2006 +0000
@@ -58,10 +58,10 @@
     /* Buffers have moved; re-obtain the pointers */
     Frame0->Y = (unsigned char *)PdGetOffscreenContextPtr(channel->yplane1);
     Frame1->Y = (unsigned char *)PdGetOffscreenContextPtr(channel->yplane2);
-    Frame0->U = (unsigned char *)PdGetOffscreenContextPtr(channel->uplane1);
-    Frame1->U = (unsigned char *)PdGetOffscreenContextPtr(channel->uplane2);
-    Frame0->V = (unsigned char *)PdGetOffscreenContextPtr(channel->vplane1);
-    Frame1->V = (unsigned char *)PdGetOffscreenContextPtr(channel->vplane2);
+    Frame0->U = (unsigned char *)PdGetOffscreenContextPtr(channel->vplane1);
+    Frame1->U = (unsigned char *)PdGetOffscreenContextPtr(channel->vplane2);
+    Frame0->V = (unsigned char *)PdGetOffscreenContextPtr(channel->uplane1);
+    Frame1->V = (unsigned char *)PdGetOffscreenContextPtr(channel->uplane2);
 
     if (Frame0->Y)
         planes++;
@@ -217,10 +217,10 @@
 
     if(overlay->hwdata->channel->yplane1 != NULL)
         overlay->hwdata->YStride = overlay->hwdata->channel->yplane1->pitch;
+    if(overlay->hwdata->channel->vplane1 != NULL)
+        overlay->hwdata->UStride = overlay->hwdata->channel->vplane1->pitch;
     if(overlay->hwdata->channel->uplane1 != NULL)
-        overlay->hwdata->UStride = overlay->hwdata->channel->uplane1->pitch;
-    if(overlay->hwdata->channel->vplane1 != NULL)
-        overlay->hwdata->VStride = overlay->hwdata->channel->vplane1->pitch;
+        overlay->hwdata->VStride = overlay->hwdata->channel->uplane1->pitch;
 
     /* check for the validness of all planes */
     if ((overlay->hwdata->channel->yplane1 == NULL) &&
@@ -267,12 +267,12 @@
     }
     if (overlay->planes > 1)
     {
-        overlay->pitches[1] = overlay->hwdata->channel->uplane1->pitch;
+        overlay->pitches[1] = overlay->hwdata->channel->vplane1->pitch;
         overlay->pixels[1]  = overlay->hwdata->CurrentFrameData->U;
     }
     if (overlay->planes > 2)
     {
-        overlay->pitches[2] = overlay->hwdata->channel->vplane1->pitch;
+        overlay->pitches[2] = overlay->hwdata->channel->uplane1->pitch;
         overlay->pixels[2]  = overlay->hwdata->CurrentFrameData->V;
     }