[Android] VideoPlayer: fix seek at opening

Thomas Guillem git at videolan.org
Thu Jun 9 13:44:34 CEST 2016


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jun  9 13:43:50 2016 +0200| [a88f93d6fbc745c1a1fa15fc90fc33b6b7a5ebd6] | committer: Thomas Guillem

VideoPlayer: fix seek at opening

The length can be negative during initialisation.

> https://code.videolan.org/videolan/vlc-android/commit/a88f93d6fbc745c1a1fa15fc90fc33b6b7a5ebd6
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 9508f00..ef124a3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2507,7 +2507,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
     private void seek(long position, float length) {
         mForcedTime = position;
         mLastTime = mService.getTime();
-        if (length == 0f)
+        if (length <= 0f)
             mService.setTime(position);
         else
             mService.setPosition(position / length);



More information about the Android mailing list