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

git at videolan.org git at videolan.org
Thu Jun 10 18:41:19 CEST 2010


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Thu Jun 10 18:09:42 2010 +0200| [30efd37a75ab41794a3999cf949a41dcb1c1dc1d] | committer: Erwan Tulou 

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 :)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=30efd37a75ab41794a3999cf949a41dcb1c1dc1d
---

 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 43062f7..af80213 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -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;
     }
 }



More information about the vlc-commits mailing list