[Android] Do not stop service too early

Geoffrey Métais git at videolan.org
Thu Jun 23 12:22:35 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jun 23 12:22:08 2016 +0200| [29ea2ff46aabddbd39ebfacacd3e0ca784df01e0] | committer: Geoffrey Métais

Do not stop service too early

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java       | 8 ++++----
 1 file changed, 4 insertions(+), 4 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 1ca34fd..0f536b4 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -859,6 +859,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
                 mService.showWithoutParse(mService.getCurrentMediaPosition());
             return;
         }
+        if (!mWasPaused)
+            mService.pause();
 
         cleanUI();
 
@@ -869,10 +871,6 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             time = 0;
         else
             time -= 2000; // go back 2 seconds, to compensate loading time
-        if (isFinishing())
-            mService.stop();
-        else
-            mService.pause();
 
         SharedPreferences.Editor editor = mSettings.edit();
         // Save position
@@ -907,6 +905,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             mService.setRate(1.0f);
 
         Util.commitPreferences(editor);
+        if (isFinishing())
+            mService.stop();
     }
 
     private void cleanUI() {



More information about the Android mailing list