[libbluray-devel] VideoControl: fix getNormalizedRectangle()

hpi1 git at videolan.org
Wed Aug 27 10:48:46 CEST 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Aug 27 10:25:23 2014 +0300| [ccc777c4b0773b51acf9e81bb77ce92d4110de75] | committer: hpi1

VideoControl: fix getNormalizedRectangle()

Values were calculated using integers. Result was 0 or 1 instead of proper float value between 0 and 1.

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

 .../java/org/videolan/media/content/playlist/VideoControl.java |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoControl.java b/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoControl.java
index ea6a618..9a11b48 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoControl.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoControl.java
@@ -37,10 +37,10 @@ public abstract class VideoControl extends StreamControl implements VideoPresent
     protected HScreenRectangle getNormalizedRectangle(Dimension dimension, Rectangle rectangle) {
         if ((dimension.width == 0) || (dimension.height == 0))
             return new HScreenRectangle(0, 0, 0, 0);
-        float x = rectangle.x / dimension.width;
-        float y = rectangle.y / dimension.height;
-        float w = rectangle.width / dimension.width;
-        float h = rectangle.height / dimension.height;
+        float x = (float)rectangle.x / dimension.width;
+        float y = (float)rectangle.y / dimension.height;
+        float w = (float)rectangle.width / dimension.width;
+        float h = (float)rectangle.height / dimension.height;
         return new HScreenRectangle(x, y, w, h);
     }
 



More information about the libbluray-devel mailing list