[Android] ABRepeat: Fix regression when history disabled

Duncan McNamara git at videolan.org
Wed Jun 12 11:26:57 UTC 2024


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Thu Jun  6 16:09:39 2024 +0200| [ee30c519e46f25c9ab6ebd071ea32fe754ac7d22] | committer: Nicolas Pomepuy

ABRepeat: Fix regression when history disabled

Removed the condition so that even with history disabled, ABRepeat
markers could still be set, but add saving the marker's position only
when history is enabled.

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

 .../vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt      | 7 ++++---
 1 file changed, 4 insertions(+), 3 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 634fcfbfd0..8917a4ebc0 100644
--- a/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -1029,7 +1029,6 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
     fun getMediaList(): List<MediaWrapper> = mediaList.copy
 
     fun setABRepeatValue(media: MediaWrapper?, time: Long) {
-        if (settings.getBoolean(PLAYBACK_HISTORY, true)) return
         val value = abRepeat.value ?: ABRepeat()
         when {
             value.start == -1L -> {
@@ -1043,8 +1042,10 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
                 value.stop = time
             }
         }
-        media?.setLongMeta(MediaWrapper.META_AB_REPEAT_START, value.start)
-        media?.setLongMeta(MediaWrapper.META_AB_REPEAT_STOP, value.stop)
+        if (settings.getBoolean(PLAYBACK_HISTORY, true)) {
+            media?.setLongMeta(MediaWrapper.META_AB_REPEAT_START, value.start)
+            media?.setLongMeta(MediaWrapper.META_AB_REPEAT_STOP, value.stop)
+        }
         abRepeat.value = value
     }
 



More information about the Android mailing list