[Android] Set the METADATA_KEY_DURATION to a negative value when the length is zero. A negative value is used to specify an unknown/infinite duration song. This allows the time to count-up when playing a stream.
Robert Stone
git at videolan.org
Wed Oct 14 09:08:33 CEST 2020
vlc-android | branch: master | Robert Stone <rhstone at gmail.com> | Mon Oct 12 19:42:30 2020 -0700| [81be758a8797a1e7f9c657cdfdc286cd8ab19cce] | committer: Nicolas Pomepuy
Set the METADATA_KEY_DURATION to a negative value when the length is zero. A negative value is used to specify an unknown/infinite duration song. This allows the time to count-up when playing a stream.
> https://code.videolan.org/videolan/vlc-android/commit/81be758a8797a1e7f9c657cdfdc286cd8ab19cce
---
application/vlc-android/src/org/videolan/vlc/PlaybackService.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt b/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
index 6132ea0d96..6f9f3c940a 100644
--- a/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
+++ b/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
@@ -846,7 +846,7 @@ class PlaybackService : MediaBrowserServiceCompat(), LifecycleOwner {
putString(MediaMetadataCompat.METADATA_KEY_ARTIST, MediaUtils.getMediaArtist(ctx, media))
putString(MediaMetadataCompat.METADATA_KEY_ALBUM_ARTIST, MediaUtils.getMediaReferenceArtist(ctx, media))
putString(MediaMetadataCompat.METADATA_KEY_ALBUM, MediaUtils.getMediaAlbum(ctx, media))
- putLong(MediaMetadataCompat.METADATA_KEY_DURATION, length)
+ putLong(MediaMetadataCompat.METADATA_KEY_DURATION, if (length != 0L) length else -1L)
}
if (coverOnLockscreen) {
val cover = AudioUtil.readCoverBitmap(Uri.decode(media.artworkMrl), 512)
More information about the Android
mailing list