Apply suggestion

This commit is contained in:
TiA4f8R 2021-12-11 15:45:25 +01:00
parent bf02a569ee
commit 3db37166b4
No known key found for this signature in database
GPG Key ID: E6D3E7F5949450DD
1 changed files with 5 additions and 4 deletions

View File

@ -4175,16 +4175,17 @@ public final class Player implements
hideSystemUIIfNeeded(); hideSystemUIIfNeeded();
} }
final int videoRenderIndex = getVideoRendererIndex(); // The current metadata may be null sometimes (for e.g. when using an unstable connection
// in livestreams) so we will be not able to execute the block below.
// The current metadata may be null sometimes so we will be not able to execute the // Reload the play queue manager in this case, which is the behavior when the video stream
// block above. Reload the play queue manager in this case. // played is not video only or when we don't know the index of the video renderer.
if (currentMetadata == null) { if (currentMetadata == null) {
reloadPlayQueueManager(); reloadPlayQueueManager();
setRecovery(); setRecovery();
return; return;
} }
final int videoRenderIndex = getVideoRendererIndex();
final StreamInfo info = currentMetadata.getMetadata(); 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