Skip to content

Commit

Permalink
Use the current overrides of the player as preset
Browse files Browse the repository at this point in the history
Issue: #10429
PiperOrigin-RevId: 461577039
  • Loading branch information
marcbaechinger authored and rohitjoins committed Jul 21, 2022
1 parent 0db07c6 commit f828130
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -65,7 +65,7 @@ public interface DialogCallback {
private boolean showDisableOption;
@Nullable private TrackNameProvider trackNameProvider;
private boolean isDisabled;
private Map<TrackGroup, TrackSelectionOverride> overrides;
private ImmutableMap<TrackGroup, TrackSelectionOverride> overrides;
@Nullable private Comparator<Format> trackFormatComparator;

/**
Expand All @@ -85,7 +85,7 @@ public TrackSelectionDialogBuilder(
this.title = title;
this.trackGroups = ImmutableList.copyOf(trackGroups);
this.callback = callback;
overrides = Collections.emptyMap();
overrides = ImmutableMap.of();
}

/**
Expand All @@ -108,7 +108,7 @@ public TrackSelectionDialogBuilder(
trackGroups.add(trackGroup);
}
}
overrides = Collections.emptyMap();
overrides = player.getTrackSelectionParameters().overrides;
callback =
(isDisabled, overrides) -> {
TrackSelectionParameters.Builder parametersBuilder =
Expand Down Expand Up @@ -169,7 +169,7 @@ public TrackSelectionDialogBuilder setOverride(@Nullable TrackSelectionOverride
*/
public TrackSelectionDialogBuilder setOverrides(
Map<TrackGroup, TrackSelectionOverride> overrides) {
this.overrides = overrides;
this.overrides = ImmutableMap.copyOf(overrides);
return this;
}

Expand Down

0 comments on commit f828130

Please sign in to comment.