[Android] Fix playlist lost on hardware acceleration error

Geoffrey Métais git at videolan.org
Wed Jan 6 18:36:02 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jan  6 18:35:15 2016 +0100| [e7428f8372e62a448643f1408ba207171e589ae8] | committer: Geoffrey Métais

Fix playlist lost on hardware acceleration error

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

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 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 0fb50bf..2bef442 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1588,14 +1588,16 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         Toast.makeText(this, R.string.hardware_acceleration_error, Toast.LENGTH_LONG).show();
         final boolean wasPaused = !mService.isPlaying();
         final long oldTime = mService.getTime();
+        int position = mService.getCurrentMediaPosition();
+        List<MediaWrapper> list = new ArrayList<>(mService.getMedias());
+        final MediaWrapper mw = list.get(position);
         mService.stop();
         if(!isFinishing()) {
-            final MediaWrapper mw = new MediaWrapper(mUri);
             if (wasPaused)
                 mw.addFlags(MediaWrapper.MEDIA_PAUSED);
             mw.addFlags(MediaWrapper.MEDIA_NO_HWACCEL);
             mw.addFlags(MediaWrapper.MEDIA_VIDEO);
-            mService.load(mw);
+            mService.load(list, position);
             if (oldTime > 0)
                 seek(oldTime);
         }



More information about the Android mailing list