[Android] PlayIndex: fix play-as-audio
Duncan McNamara
git at videolan.org
Tue Apr 8 04:59:23 UTC 2025
vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Thu Apr 3 16:05:10 2025 +0200| [50402c904b40b73e2200fc08fe99832f1e7483fa] | committer: Nicolas Pomepuy
PlayIndex: fix play-as-audio
By getting a media from the medialibrary from the the currentmedia's uri
to ensure that we have the medialibrary metadata for the file, the new
media from the same uri won't have the flags previously set, including
MEDIA_FORCE_AUDIO which start the media as audio.
To fix this, the flags from the previous mediawrapper are applied to the
new one.
Fixed a regression introduced by ea39df7bb705507c41dd081732588335878142ba
> https://code.videolan.org/videolan/vlc-android/commit/50402c904b40b73e2200fc08fe99832f1e7483fa
---
application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt | 1 +
1 file changed, 1 insertion(+)
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 ff77ea043a..048518d45d 100644
--- a/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -484,6 +484,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
val media = mediaList.getMedia(index) ?: return
val mw = medialibrary.getMedia(media.uri) ?: media
+ mw.flags = media.flags
val isInCustomPiP: Boolean = service.isInPiPMode.value ?: false
if (mw.type == MediaWrapper.TYPE_VIDEO && !isAppStarted() && !isInCustomPiP) videoBackground = true
val isVideoPlaying = mw.type == MediaWrapper.TYPE_VIDEO && player.isVideoPlaying()
More information about the Android
mailing list