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 82ae0df27..9f95aa519 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -3557,14 +3557,19 @@ public final class Player implements } // apply caption language from previous user preference - final List selectedPreferredLanguages = - trackSelector.getParameters().preferredTextLanguages; final String userPreferredLanguage = prefs.getString(context.getString(R.string.caption_user_set_key), null); final int textRendererIndex = getCaptionRendererIndex(); - if (userPreferredLanguage != null - && !selectedPreferredLanguages.contains(userPreferredLanguage) + if (userPreferredLanguage == null) { + trackSelector.setParameters(trackSelector.buildUponParameters() + .setRendererDisabled(textRendererIndex, true)); + return; + } + + final List selectedPreferredLanguages = + trackSelector.getParameters().preferredTextLanguages; + if (!selectedPreferredLanguages.contains(userPreferredLanguage) && textRendererIndex != RENDERER_UNAVAILABLE) { trackSelector.setParameters(trackSelector.buildUponParameters() .setPreferredTextLanguages(userPreferredLanguage,