From 3db37166b4e0e298286e42e94d7249ccfdb5d745 Mon Sep 17 00:00:00 2001 From: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> Date: Sat, 11 Dec 2021 15:45:25 +0100 Subject: [PATCH] Apply suggestion --- app/src/main/java/org/schabi/newpipe/player/Player.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/Player.java b/app/src/main/java/org/schabi/newpipe/player/Player.java index 68601a919..5b66bea6d 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -4175,16 +4175,17 @@ public final class Player implements hideSystemUIIfNeeded(); } - final int videoRenderIndex = getVideoRendererIndex(); - - // The current metadata may be null sometimes so we will be not able to execute the - // block above. Reload the play queue manager in this case. + // 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. + // Reload the play queue manager in this case, which is the behavior when the video stream + // played is not video only or when we don't know the index of the video renderer. if (currentMetadata == null) { reloadPlayQueueManager(); setRecovery(); return; } + final int videoRenderIndex = getVideoRendererIndex(); final StreamInfo info = currentMetadata.getMetadata(); /* For video streams: we don't want to stream in background the video stream so if the