Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to ExoPlayer 2.12.3 #5457

Merged
merged 2 commits into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions app/src/main/java/org/schabi/newpipe/player/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ public float getPlaybackPitch() {
}

public boolean getPlaybackSkipSilence() {
return simpleExoPlayer != null
return !exoPlayerIsNull() && simpleExoPlayer.getAudioComponent() != null
&& simpleExoPlayer.getAudioComponent().getSkipSilenceEnabled();
}

Expand All @@ -1460,7 +1460,9 @@ public void setPlaybackParameters(final float speed, final float pitch,
savePlaybackParametersToPrefs(this, roundedSpeed, roundedPitch, skipSilence);
simpleExoPlayer.setPlaybackParameters(
new PlaybackParameters(roundedSpeed, roundedPitch));
simpleExoPlayer.getAudioComponent().setSkipSilenceEnabled(skipSilence);
if (simpleExoPlayer.getAudioComponent() != null) {
simpleExoPlayer.getAudioComponent().setSkipSilenceEnabled(skipSilence);
}
}
//endregion

Expand Down Expand Up @@ -2336,6 +2338,7 @@ public void onPlayerError(@NonNull final ExoPlaybackException error) {
case ExoPlaybackException.TYPE_OUT_OF_MEMORY:
case ExoPlaybackException.TYPE_REMOTE:
case ExoPlaybackException.TYPE_RENDERER:
case ExoPlaybackException.TYPE_TIMEOUT:
default:
showUnrecoverableError(error);
onPlaybackShutdown();
Expand Down Expand Up @@ -3358,7 +3361,7 @@ private void onTextTracksChanged() {
final List<String> availableLanguages = new ArrayList<>(textTracks.length);
for (int i = 0; i < textTracks.length; i++) {
final TrackGroup textTrack = textTracks.get(i);
if (textTrack.length > 0 && textTrack.getFormat(0) != null) {
Redirion marked this conversation as resolved.
Show resolved Hide resolved
if (textTrack.length > 0) {
availableLanguages.add(textTrack.getFormat(0).language);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ public boolean retainBackBufferFromKeyframe() {

@Override
public boolean shouldContinueLoading(final long playbackPositionUs,
final long bufferedDurationUs, final float playbackSpeed) {
final long bufferedDurationUs,
final float playbackSpeed) {
if (!preloadingEnabled) {
return false;
}
return internalLoadControl.shouldContinueLoading(playbackPositionUs, bufferedDurationUs,
playbackSpeed);
return internalLoadControl.shouldContinueLoading(
playbackPositionUs, bufferedDurationUs, playbackSpeed);
}

@Override
Expand Down