vlc | branch: master | Hugo Beauzée-Luyssen <[email protected]> | Mon Apr  3 
18:05:15 2017 +0200| [cc81f0322f59db17362cfe17ca6851644622f075] | committer: 
Hugo Beauzée-Luyssen

vout: vout_display_PlacePicture: Avoir potential loss of precision

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

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

diff --git a/src/video_output/display.c b/src/video_output/display.c
index 310f208..77b4ef7 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -228,9 +228,9 @@ void vout_display_PlacePicture(vout_display_place_t *place,
     const unsigned width  = source->i_visible_width;
     const unsigned height = source->i_visible_height;
     /* Compute the height if we use the width to fill up display_width */
-    const int64_t scaled_height = (int64_t)height * display_width  * 
cfg->display.sar.num * source->i_sar_den / width  / source->i_sar_num / 
cfg->display.sar.den;
+    const int64_t scaled_height = (int64_t)height * display_width  * 
cfg->display.sar.num * source->i_sar_den / (width  * source->i_sar_num * 
cfg->display.sar.den);
     /* And the same but switching width/height */
-    const int64_t scaled_width  = (int64_t)width  * display_height * 
cfg->display.sar.den * source->i_sar_num / height / source->i_sar_den / 
cfg->display.sar.num;
+    const int64_t scaled_width  = (int64_t)width  * display_height * 
cfg->display.sar.den * source->i_sar_num / (height * source->i_sar_den * 
cfg->display.sar.num);
 
     if (source->projection_mode == PROJECTION_MODE_RECTANGULAR) {
         /* We keep the solution that avoid filling outside the display */

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to