]> git.sesse.net Git - vlc/commitdiff
core: fix a wrong division
authorErwan Tulou <erwan10@videolan.org>
Thu, 10 Jun 2010 16:09:42 +0000 (18:09 +0200)
committerErwan Tulou <erwan10@videolan.org>
Thu, 10 Jun 2010 16:37:28 +0000 (18:37 +0200)
Dividing an unsigned int by 2 is different from dividing an int by 2

This division was the cause for vlc(Win32) displaying a black screen
when zooming exceeded the display size (alt-'o')

Weirdly, there was no problem for Linux !!?? and also no regression :)

src/video_output/display.c

index 43062f75f02f1822b6eb1f8378ecf85b40abd545..af80213e150ac20236b5820bc85dc1a2fa24bca0 100644 (file)
@@ -255,7 +255,7 @@ void vout_display_PlacePicture(vout_display_place_t *place,
         place->x = cfg->display.width - place->width;
         break;
     default:
-        place->x = (cfg->display.width - place->width) / 2;
+        place->x = ((int)cfg->display.width - (int)place->width) / 2;
         break;
     }
 
@@ -267,7 +267,7 @@ void vout_display_PlacePicture(vout_display_place_t *place,
         place->y = cfg->display.height - place->height;
         break;
     default:
-        place->y = (cfg->display.height - place->height) / 2;
+        place->y = ((int)cfg->display.height - (int)place->height) / 2;
         break;
     }
 }