mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
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
7ca69e091c
commit
0ba6e37ff9
@ -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