[Android] VideoPlayer: fix seek at opening

Thomas Guillem git at videolan.org
Thu Jun 9 15:10:01 CEST 2016


vlc-android | branch: 2.0.x | Thomas Guillem <thomas at gllm.fr> | Thu Jun  9 13:43:50 2016 +0200| [58dd111110c4861c386e36a80f7c6dfb387e9e00] | committer: Geoffrey Métais

VideoPlayer: fix seek at opening

The length can be negative during initialisation.

(cherry picked from commit a88f93d6fbc745c1a1fa15fc90fc33b6b7a5ebd6)

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

 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 8481199..549b213 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