[Android] Video player: Fix resume dialog

Geoffrey Métais git at videolan.org
Thu Mar 14 14:23:26 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Mar 14 14:22:55 2019 +0100| [bb5f2b0e39beea456f5e41bb978c7874ba98c75d] | committer: Geoffrey Métais

Video player: Fix resume dialog

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java        | 7 ++++---
 1 file changed, 4 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 f3678b1bb..f98549e66 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2544,7 +2544,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
                     media = openedMedia;
                 if (media != null) {
                     // in media library
-                    if (mAskResume && !fromStart && positionInPlaylist == -1 && media.getTime() > 0) {
+                    if (mAskResume && !fromStart && positionInPlaylist <= 0 && media.getTime() > 0) {
                         showConfirmResumeDialog();
                         return;
                     }
@@ -2583,10 +2583,11 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
                 media.addFlags(MediaWrapper.MEDIA_NO_HWACCEL);
             media.removeFlags(MediaWrapper.MEDIA_FORCE_AUDIO);
             media.addFlags(MediaWrapper.MEDIA_VIDEO);
+            if (fromStart) media.addFlags(MediaWrapper.MEDIA_FROM_START);
 
             // Set resume point
-            if (!continueplayback) {
-                if (!fromStart && savedTime <= 0L && media.getTime() > 0L) savedTime = media.getTime();
+            if (!continueplayback && !fromStart) {
+                if (savedTime <= 0L && media.getTime() > 0L) savedTime = media.getTime();
                 if (savedTime > 0L) mService.saveStartTime(savedTime);
             }
 



More information about the Android mailing list