[vlc-commits] commit: core: fix a wrong division (Erwan Tulou )

git at videolan.org git at videolan.org
Fri Jun 11 00:34:20 CEST 2010


vlc/vlc-1.1 | branch: master | Erwan Tulou <erwan10 at videolan.org> | Thu Jun 10 18:09:42 2010 +0200| [5beedc2349bc1869288242b841b0b6354b016632] | committer: Jean-Baptiste Kempf 

core: fix a wrong division

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 :)
(cherry picked from commit 30efd37a75ab41794a3999cf949a41dcb1c1dc1d)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=5beedc2349bc1869288242b841b0b6354b016632
---

 src/video_output/display.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/video_output/display.c b/src/video_output/display.c
index fa92cf8..198cd8f 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -253,7 +253,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;
     }
 
@@ -265,7 +265,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;
     }
 }



More information about the vlc-commits mailing list