[Android] Always add force audio flag

Robert Stone git at videolan.org
Tue Jul 12 07:56:38 UTC 2022


vlc-android | branch: master | Robert Stone <rhstone at gmail.com> | Mon Jul 11 23:59:17 2022 -0700| [82c1233b5e6925cc8aee0903f3cb2cb0503bf311] | committer: Robert Stone

Always add force audio flag

Fixes #2431

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

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

diff --git a/application/vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt b/application/vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt
index 8f2bd114e..d55d42eae 100644
--- a/application/vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt
+++ b/application/vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt
@@ -258,7 +258,7 @@ internal class MediaSessionCallback(private val playbackService: PlaybackService
     private fun loadMedia(mediaList: List<MediaWrapper>?, position: Int = 0, allowRandom: Boolean = false) {
         mediaList?.let {
             if (AndroidDevices.isCarMode(playbackService.applicationContext))
-                mediaList.forEach { mw -> if (mw.type == MediaWrapper.TYPE_VIDEO) mw.addFlags(MediaWrapper.MEDIA_FORCE_AUDIO) }
+                mediaList.forEach { mw -> mw.addFlags(MediaWrapper.MEDIA_FORCE_AUDIO) }
             // Pick a random first track if allowRandom is true and shuffle is enabled
             playbackService.load(mediaList, if (allowRandom && playbackService.isShuffling) SecureRandom().nextInt(min(mediaList.size, MEDIALIBRARY_PAGE_SIZE)) else position)
         }



More information about the Android mailing list