Apply suggestion
This commit is contained in:
parent
79f8270c35
commit
cc96ac173c
|
@ -3003,25 +3003,18 @@ public final class Player implements
|
||||||
final MediaSourceTag metadata;
|
final MediaSourceTag metadata;
|
||||||
try {
|
try {
|
||||||
final MediaItem currentMediaItem = simpleExoPlayer.getCurrentMediaItem();
|
final MediaItem currentMediaItem = simpleExoPlayer.getCurrentMediaItem();
|
||||||
if (currentMediaItem != null) {
|
if (currentMediaItem == null || currentMediaItem.playbackProperties == null
|
||||||
final MediaItem.PlaybackProperties playbackProperties =
|
|| currentMediaItem.playbackProperties.tag == null) {
|
||||||
currentMediaItem.playbackProperties;
|
return;
|
||||||
metadata = (MediaSourceTag) (playbackProperties != null ? playbackProperties.tag
|
|
||||||
: null);
|
|
||||||
} else {
|
|
||||||
metadata = null;
|
|
||||||
}
|
}
|
||||||
} catch (final IndexOutOfBoundsException | ClassCastException error) {
|
metadata = (MediaSourceTag) currentMediaItem.playbackProperties.tag;
|
||||||
|
} catch (final IndexOutOfBoundsException | ClassCastException ex) {
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.d(TAG, "Could not update metadata: " + error.getMessage());
|
Log.d(TAG, "Could not update metadata", ex);
|
||||||
error.printStackTrace();
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (metadata == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
maybeAutoQueueNextStream(metadata);
|
maybeAutoQueueNextStream(metadata);
|
||||||
|
|
||||||
if (currentMetadata == metadata) {
|
if (currentMetadata == metadata) {
|
||||||
|
|
Loading…
Reference in New Issue