[Android] Fix wrong media progress with external medias

Nicolas Pomepuy git at videolan.org
Tue Apr 5 10:11:28 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Apr  5 09:10:09 2022 +0200| [df720bcb2e4bc1d1f9caec7beda5b5477c00054d] | committer: Duncan McNamara

Fix wrong media progress with external medias

Fixes #2345

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

 application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt b/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
index a521e202e..6c8711f71 100644
--- a/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -1053,9 +1053,9 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
                     }
                 }
             }
-            val length = player.getLength()
+            val time = player.getCurrentTime()
             val canSwitchToVideo = player.canSwitchToVideo()
-            if (id != 0L && mw.type != MediaWrapper.TYPE_VIDEO && !canSwitchToVideo && !mw.isPodcast) if (length == 0L) medialibrary.setLastPosition(id, 1.0f) else  medialibrary.setLastTime(id, length)
+            if (id != 0L && mw.type != MediaWrapper.TYPE_VIDEO && !canSwitchToVideo && !mw.isPodcast) if (mw.length == 0L) medialibrary.setLastPosition(id, player.lastPosition) else  medialibrary.setLastTime(id, time)
         }
     }
 



More information about the Android mailing list