Apply suggestion

This commit is contained in:
TiA4f8R 2021-11-16 19:25:46 +01:00
parent 79f8270c35
commit cc96ac173c
No known key found for this signature in database
GPG Key ID: E6D3E7F5949450DD
1 changed files with 6 additions and 13 deletions

View File

@ -3003,25 +3003,18 @@ public final class Player implements
final MediaSourceTag metadata;
try {
final MediaItem currentMediaItem = simpleExoPlayer.getCurrentMediaItem();
if (currentMediaItem != null) {
final MediaItem.PlaybackProperties playbackProperties =
currentMediaItem.playbackProperties;
metadata = (MediaSourceTag) (playbackProperties != null ? playbackProperties.tag
: null);
} else {
metadata = null;
if (currentMediaItem == null || currentMediaItem.playbackProperties == null
|| currentMediaItem.playbackProperties.tag == null) {
return;
}
} catch (final IndexOutOfBoundsException | ClassCastException error) {
metadata = (MediaSourceTag) currentMediaItem.playbackProperties.tag;
} catch (final IndexOutOfBoundsException | ClassCastException ex) {
if (DEBUG) {
Log.d(TAG, "Could not update metadata: " + error.getMessage());
error.printStackTrace();
Log.d(TAG, "Could not update metadata", ex);
}
return;
}
if (metadata == null) {
return;
}
maybeAutoQueueNextStream(metadata);
if (currentMetadata == metadata) {