[Android] Handle seek to negative values

Geoffrey Métais git at videolan.org
Mon Jul 16 15:15:36 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jul 16 15:15:14 2018 +0200| [043dd899bdc60c73871a76d4e1c94d3ff8124bf9] | committer: Geoffrey Métais

Handle seek to negative values

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

 vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt b/vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt
index 001bb49c9..3fd32a253 100644
--- a/vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt
+++ b/vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt
@@ -111,7 +111,7 @@ internal class MediaSessionCallback(private val playbackService: PlaybackService
 
     override fun onSkipToPrevious() = playbackService.previous(true)
 
-    override fun onSeekTo(pos: Long) = playbackService.seek(pos)
+    override fun onSeekTo(pos: Long) = playbackService.seek(if (pos < 0) playbackService.time + pos else pos)
 
     override fun onFastForward() = playbackService.seek(Math.min(playbackService.length, playbackService.time + 5000))
 



More information about the Android mailing list