Removed useless check for livestreams

This commit is contained in:
litetex 2021-09-25 00:04:53 +02:00
parent ba0876b43b
commit bbc13756f3
1 changed files with 2 additions and 10 deletions

View File

@ -150,10 +150,10 @@ public class MediaSessionManager {
return true;
}
// Check if the current metadata is valid
// Check if the currently set metadata is valid
if (getMetadataTitle() == null
|| getMetadataArtist() == null
|| getMetadataDuration() <= 1
// Note that the duration can be <= 0 for live streams
) {
if (DEBUG) {
if (getMetadataTitle() == null) {
@ -162,9 +162,6 @@ public class MediaSessionManager {
} else if (getMetadataArtist() == null) {
Log.d(TAG,
"N_getMetadataArtist: artist == null");
} else if (getMetadataDuration() <= 1) {
Log.d(TAG,
"N_getMetadataDuration: duration <= 1; " + getMetadataDuration());
}
}
return true;
@ -200,11 +197,6 @@ public class MediaSessionManager {
.getString(MediaMetadataCompat.METADATA_KEY_ARTIST);
}
private long getMetadataDuration() {
return mediaSession.getController().getMetadata()
.getLong(MediaMetadataCompat.METADATA_KEY_DURATION);
}
/**
* Should be called on player destruction to prevent leakage.
*/