[Android] Don't update the elapsed and total time if they are negative
Ludovic Fauvet
git at videolan.org
Mon Jul 15 09:28:52 CEST 2013
vlc-ports/android | branch: master | Ludovic Fauvet <etix at videolan.org> | Mon Jul 15 01:36:59 2013 +0200| [6196610ceab9a9e89d7408f8ccf62ded4a2a5e96] | committer: Ludovic Fauvet
Don't update the elapsed and total time if they are negative
This should fix the issue where "-0:00" shows up from time to time
when exiting the video player.
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=6196610ceab9a9e89d7408f8ccf62ded4a2a5e96
---
.../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 6 +++---
1 file changed, 3 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 c8bce90..67c12f0 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1367,14 +1367,14 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
}
int time = (int) mLibVLC.getTime();
int length = (int) mLibVLC.getLength();
- // Update all view elements
+ // Update all view elements
mControls.setSeekable(length > 0);
mSeekbar.setMax(length);
mSeekbar.setProgress(time);
mSysTime.setText(DateFormat.getTimeFormat(this).format(new Date(System.currentTimeMillis())));
- mTime.setText(Util.millisToString(time));
- mLength.setText(mDisplayRemainingTime && length > 0
+ if (time >= 0) mTime.setText(Util.millisToString(time));
+ if (length >= 0) mLength.setText(mDisplayRemainingTime && length > 0
? "- " + Util.millisToString(length - time)
: Util.millisToString(length));
More information about the Android
mailing list