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
This commit is contained in:
parent
beccfaba3b
commit
70e2e8e4d0
@ -2075,6 +2075,7 @@ public class StyledPlayerControlView extends FrameLayout {
|
||||
|
||||
@Override
|
||||
public void init(List<TrackInformation> trackInformations) {
|
||||
this.tracks = trackInformations;
|
||||
// Update subtext in settings menu with current audio track selection.
|
||||
TrackSelectionParameters params = checkNotNull(player).getTrackSelectionParameters();
|
||||
if (trackInformations.isEmpty()) {
|
||||
@ -2097,7 +2098,6 @@ public class StyledPlayerControlView extends FrameLayout {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.tracks = trackInformations;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user