Fix a NullPointerException when the current metadata is null
Reload the play queue manager and set the recovery in this case, like on the current behavior (without this PR).
This commit is contained in:
parent
015982bed4
commit
bf02a569ee
1 changed files with 9 additions and 3 deletions
|
@ -4177,9 +4177,15 @@ public final class Player implements
|
||||||
|
|
||||||
final int videoRenderIndex = getVideoRendererIndex();
|
final int videoRenderIndex = getVideoRendererIndex();
|
||||||
|
|
||||||
// We can safely assume that currentMetadata is not null (otherwise this method isn't
|
// The current metadata may be null sometimes so we will be not able to execute the
|
||||||
// called) so we can use the requireNonNull method of the Objects class.
|
// block above. Reload the play queue manager in this case.
|
||||||
final StreamInfo info = Objects.requireNonNull(currentMetadata).getMetadata();
|
if (currentMetadata == null) {
|
||||||
|
reloadPlayQueueManager();
|
||||||
|
setRecovery();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final StreamInfo info = currentMetadata.getMetadata();
|
||||||
|
|
||||||
/* For video streams: we don't want to stream in background the video stream so if the
|
/* For video streams: we don't want to stream in background the video stream so if the
|
||||||
video stream played is not a video-only stream and if there is an audio stream available,
|
video stream played is not a video-only stream and if there is an audio stream available,
|
||||||
|
|
Loading…
Add table
Reference in a new issue