Commit 0ba6e37f by tonihei

Assign class member in StyledPlayerControlView before using it

The local tracks variable was used to assign the initial subtext
for the current track selection in the menu, but the new value
was only assigned after the subtext has been evaluated.

Assign the local variable first, so that the remaining accesses
the latest value.

Issue: google/ExoPlayer#9698
PiperOrigin-RevId: 410750396
parent 7ca69e09
...@@ -2075,6 +2075,7 @@ public class StyledPlayerControlView extends FrameLayout { ...@@ -2075,6 +2075,7 @@ public class StyledPlayerControlView extends FrameLayout {
@Override @Override
public void init(List<TrackInformation> trackInformations) { public void init(List<TrackInformation> trackInformations) {
this.tracks = trackInformations;
// Update subtext in settings menu with current audio track selection. // Update subtext in settings menu with current audio track selection.
TrackSelectionParameters params = checkNotNull(player).getTrackSelectionParameters(); TrackSelectionParameters params = checkNotNull(player).getTrackSelectionParameters();
if (trackInformations.isEmpty()) { if (trackInformations.isEmpty()) {
...@@ -2097,7 +2098,6 @@ public class StyledPlayerControlView extends FrameLayout { ...@@ -2097,7 +2098,6 @@ public class StyledPlayerControlView extends FrameLayout {
} }
} }
} }
this.tracks = trackInformations;
} }
} }
......
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