[Android] Set PAUSED flag if needed on loaded video

Geoffrey Métais git at videolan.org
Wed Jun 21 13:24:06 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jun 21 13:23:12 2017 +0200| [800ae007a618e86325bee7f98c143b0d4583c5bf] | committer: Geoffrey Métais

Set PAUSED flag if needed on loaded video

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

 vlc-android/src/org/videolan/vlc/PlaybackService.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 8b34dd979..3bb30bad4 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -1593,15 +1593,15 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
                             position = mSettings.getInt(audio ? "position_in_audio_list" : "position_in_media_list", 0);
                             mSavedTime = mSettings.getLong(audio ? "position_in_song" : "position_in_media", -1);
                         }
-                        load(playList, position);
                         if (!audio) {
                             boolean paused = mSettings.getBoolean(PreferencesActivity.VIDEO_PAUSED, !isPlaying());
-                            float rate = mSettings.getFloat(PreferencesActivity.VIDEO_SPEED, getRate());
                             if (paused)
-                                pause();
+                                playList.get(position).addFlags(MediaWrapper.MEDIA_PAUSED);
+                            float rate = mSettings.getFloat(PreferencesActivity.VIDEO_SPEED, getRate());
                             if (rate != 1.0f)
                                 setRate(rate, false);
                         }
+                        load(playList, position);
                     }
                 });
             }
@@ -1627,7 +1627,7 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
     }
 
     private synchronized void savePosition(){
-        if (getCurrentMedia() == null)
+        if (!hasMedia())
             return;
         SharedPreferences.Editor editor = mSettings.edit();
         boolean audio = mMediaList.isAudioList();



More information about the Android mailing list