[Android] Audio service: fix the playlist reoordering in the case an item gets moved over the currently played item

Adrien Maglo git at videolan.org
Thu Jan 23 22:48:38 CET 2014


vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Thu Jan 23 22:48:22 2014 +0100| [8fb0f5d97c2ad4e3d572eebe1163e8d54a10207f] | committer: Adrien Maglo

Audio service: fix the playlist reoordering in the case an item gets moved over the currently played item

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=8fb0f5d97c2ad4e3d572eebe1163e8d54a10207f
---

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

diff --git a/vlc-android/src/org/videolan/vlc/AudioService.java b/vlc-android/src/org/videolan/vlc/AudioService.java
index a036d1c..d7a3f85 100644
--- a/vlc-android/src/org/videolan/vlc/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/AudioService.java
@@ -1181,6 +1181,10 @@ public class AudioService extends Service {
                 if (positionEnd > positionStart)
                     mCurrentIndex--;
             }
+            else if (positionStart > mCurrentIndex && positionEnd <= mCurrentIndex)
+                mCurrentIndex++;
+            else if (positionStart < mCurrentIndex && positionEnd >= mCurrentIndex)
+                mCurrentIndex--;
 
             // If we are in random mode, we completely reset the stored previous track
             // as their indices changed.



More information about the Android mailing list