[Android] VideoPlayer: simplify sar calculations
Jean-Baptiste Kempf
git at videolan.org
Sun Apr 13 17:45:04 CEST 2014
vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Apr 13 17:40:58 2014 +0200| [53789d623f317f27acf857cf6f642bc066c8deba] | committer: Jean-Baptiste Kempf
VideoPlayer: simplify sar calculations
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=53789d623f317f27acf857cf6f642bc066c8deba
---
.../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index d332bcb..a5c2637 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1004,14 +1004,13 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
// compute the aspect ratio
double ar, vw;
- double density = (double)mSarNum / (double)mSarDen;
- if (density == 1.0) {
+ if (mSarDen == mSarNum) {
/* No indication about the density, assuming 1:1 */
vw = mVideoVisibleWidth;
ar = (double)mVideoVisibleWidth / (double)mVideoVisibleHeight;
} else {
/* Use the specified aspect ratio */
- vw = mVideoVisibleWidth * density;
+ vw = mVideoVisibleWidth * (double)mSarNum / mSarDen;
ar = vw / mVideoVisibleHeight;
}
More information about the Android
mailing list