[Android] Fix notification intent on wrong media

Geoffrey Métais git at videolan.org
Tue Mar 1 18:09:36 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Mar  1 18:06:42 2016 +0100| [c37395f49e96c2629a7390227286dc1d6f194d3d] | committer: Geoffrey Métais

Fix notification intent on wrong media

Remove savedIndexPosition variable which led to wrong index position

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java      | 9 ++-------
 1 file changed, 2 insertions(+), 7 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 0631aef..8f04d44 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -252,9 +252,6 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
     private boolean mHardwareAccelerationError;
     private boolean mHasSubItems = false;
 
-    // Playlist
-    private int savedIndexPosition = -1;
-
     // size of the video
     private int mVideoHeight;
     private int mVideoWidth;
@@ -829,7 +826,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
 
         if(mSwitchingView && mService != null) {
             Log.d(TAG, "mLocation = \"" + mUri + "\"");
-            mService.showWithoutParse(savedIndexPosition);
+            mService.showWithoutParse(mService.getCurrentMediaPosition());
             return;
         }
 
@@ -2732,7 +2729,6 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             }
             mUri = openedMedia.getUri();
             itemTitle = openedMedia.getTitle();
-            savedIndexPosition = openedPosition;
             updateSeekable(mService.isSeekable());
             updatePausable(mService.isPausable());
         }
@@ -2791,13 +2787,12 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
                 mw.addFlags(MediaWrapper.MEDIA_VIDEO);
                 mService.addCallback(this);
                 mService.load(mw);
-                savedIndexPosition = mService.getCurrentMediaPosition();
             } else {
                 mService.getCurrentMediaWrapper().addFlags(MediaWrapper.MEDIA_VIDEO);
                 mService.addCallback(this);
                 // AudioService-transitioned playback for item after sleep and resume
                 if(!mService.isPlaying())
-                    mService.playIndex(savedIndexPosition);
+                    mService.playIndex(openedPosition);
                 else
                     onPlaying();
             }



More information about the Android mailing list