[MPlayer-cvslog] r33405 - trunk/libvo/vo_sdl.c

reimar subversion at mplayerhq.hu
Sat May 7 21:17:04 CEST 2011


Author: reimar
Date: Sat May  7 21:17:04 2011
New Revision: 33405

Log:
Fix strict-aliasing violation warnings.

Modified:
   trunk/libvo/vo_sdl.c

Modified: trunk/libvo/vo_sdl.c
==============================================================================
--- trunk/libvo/vo_sdl.c	Sat May  7 21:09:13 2011	(r33404)
+++ trunk/libvo/vo_sdl.c	Sat May  7 21:17:04 2011	(r33405)
@@ -1187,12 +1187,12 @@ static void erase_rectangle(int x, int y
         case IMGFMT_YVYU:
         {
                 /* yuy2 and yvyu represent black the same way */
-            uint8_t yuy2_black[] = {0, 128, 0, 128};
+            uint32_t yuy2_black = HAVE_BIGENDIAN ? 0x00800080 : 0x80008000;
 
             SDL_OVR_LOCK((void) 0)
                 erase_area_4(x*2, w*2, h,
                              priv->overlay->pitches[0],
-                             *((uint32_t*) yuy2_black),
+                             yuy2_black,
                              priv->overlay->pixels[0] +
                              priv->overlay->pitches[0]*y);
             SDL_OVR_UNLOCK
@@ -1201,12 +1201,12 @@ static void erase_rectangle(int x, int y
 
         case IMGFMT_UYVY:
         {
-            uint8_t uyvy_black[] = {128, 0, 128, 0};
+            uint32_t uyvy_black = HAVE_BIGENDIAN ? 0x80008000 : 0x00800080;
 
             SDL_OVR_LOCK((void) 0)
                 erase_area_4(x*2, w*2, h,
                              priv->overlay->pitches[0],
-                             *((uint32_t*) uyvy_black),
+                             uyvy_black,
                              priv->overlay->pixels[0] +
                              priv->overlay->pitches[0]*y);
             SDL_OVR_UNLOCK


More information about the MPlayer-cvslog mailing list