Commit 3cc93b1f by ibaker Committed by tonihei

Add null check to `ExoPlayerImpl.isTunnelingEnabled`

`TrackSelectorResult.rendererConfigurations` can contain null elements:
> A null entry indicates the corresponding renderer should be disabled.

This wasn't caught by the nullness checker because `ExoPlayerImpl` is
currently excluded from analysis.

#minor-release

Issue: google/ExoPlayer#10977
PiperOrigin-RevId: 508619169
(cherry picked from commit a6dfcf77)
parent 0ebb8ff3
...@@ -32,6 +32,8 @@ This release corresponds to the ...@@ -32,6 +32,8 @@ This release corresponds to the
parsing trak atoms. parsing trak atoms.
* Correctly skip samples when seeking directly to a sync frame in fMP4 * Correctly skip samples when seeking directly to a sync frame in fMP4
([#10941](https://github.com/google/ExoPlayer/issues/10941)). ([#10941](https://github.com/google/ExoPlayer/issues/10941)).
* Fix `NullPointerException` when calling `ExoPlayer.isTunnelingEnabled`
([#10977](https://github.com/google/ExoPlayer/issues/10977)).
* Audio: * Audio:
* Use the compressed audio format bitrate to calculate the min buffer size * Use the compressed audio format bitrate to calculate the min buffer size
for `AudioTrack` in direct playbacks (passthrough). for `AudioTrack` in direct playbacks (passthrough).
......
...@@ -1724,8 +1724,9 @@ import java.util.concurrent.TimeoutException; ...@@ -1724,8 +1724,9 @@ import java.util.concurrent.TimeoutException;
@Override @Override
public boolean isTunnelingEnabled() { public boolean isTunnelingEnabled() {
verifyApplicationThread(); verifyApplicationThread();
for (RendererConfiguration config : playbackInfo.trackSelectorResult.rendererConfigurations) { for (@Nullable
if (config.tunneling) { RendererConfiguration config : playbackInfo.trackSelectorResult.rendererConfigurations) {
if (config != null && config.tunneling) {
return true; return true;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment