[Android] ABRepeat: fix overlay on context change

Duncan McNamara git at videolan.org
Tue Jul 11 08:10:33 UTC 2023


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Tue Jun 27 17:54:00 2023 +0200| [9cf40e01f1a57f2677284c065401be23bfec775f] | committer: Nicolas Pomepuy

ABRepeat: fix overlay on context change

The ABRepeat value has to be set instead of start / stop variable from
the ABRepeat object for the observer to be triggered correctly.

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

 application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt | 3 +--
 1 file changed, 1 insertion(+), 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 59ebbbf97a..34527ba541 100644
--- a/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -618,9 +618,8 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
             val abStart = media.getMetaLong(MediaWrapper.META_AB_REPEAT_START)
             if (abStart != 0L) {
                 abRepeatOn.value = true
-                abRepeat.value?.start = abStart
                 val abStop = media.getMetaLong(MediaWrapper.META_AB_REPEAT_STOP)
-                abRepeat.value?.stop = if (abStop == 0L) -1L else abStop
+                abRepeat.postValue(ABRepeat(abStart, if (abStop == 0L) -1L else abStop))
             }
             player.setSpuTrack(media.getMetaLong(MediaWrapper.META_SUBTITLE_TRACK).toString())
             player.setSpuDelay(media.getMetaLong(MediaWrapper.META_SUBTITLE_DELAY))



More information about the Android mailing list