Skip to content

Commit 3db3716

Browse files
committed
Apply suggestion
1 parent bf02a56 commit 3db3716

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/Player.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4175,16 +4175,17 @@ private void useVideoSource(final boolean videoEnabled) {
41754175
hideSystemUIIfNeeded();
41764176
}
41774177

4178-
final int videoRenderIndex = getVideoRendererIndex();
4179-
4180-
// The current metadata may be null sometimes so we will be not able to execute the
4181-
// block above. Reload the play queue manager in this case.
4178+
// The current metadata may be null sometimes (for e.g. when using an unstable connection
4179+
// in livestreams) so we will be not able to execute the block below.
4180+
// Reload the play queue manager in this case, which is the behavior when the video stream
4181+
// played is not video only or when we don't know the index of the video renderer.
41824182
if (currentMetadata == null) {
41834183
reloadPlayQueueManager();
41844184
setRecovery();
41854185
return;
41864186
}
41874187

4188+
final int videoRenderIndex = getVideoRendererIndex();
41884189
final StreamInfo info = currentMetadata.getMetadata();
41894190

41904191
/* For video streams: we don't want to stream in background the video stream so if the

0 commit comments

Comments
 (0)