|
38 | 38 | import com.google.common.collect.Iterables; |
39 | 39 | import com.google.common.collect.Multimap; |
40 | 40 | import com.google.common.collect.MultimapBuilder; |
| 41 | +import com.google.errorprone.annotations.CanIgnoreReturnValue; |
41 | 42 | import java.util.ArrayList; |
42 | 43 | import java.util.Arrays; |
43 | 44 | import java.util.Comparator; |
@@ -237,19 +238,18 @@ public Factory( |
237 | 238 | * Sets the comparator used to order formats in adaptive track selections. The comparator order |
238 | 239 | * controls which formats are considered first during adaptation. |
239 | 240 | * |
| 241 | + * <p>The default is {@link BaseTrackSelection#DEFAULT_FORMAT_COMPARATOR}, which decides the |
| 242 | + * priority based on the bitrate. |
| 243 | + * |
240 | 244 | * @param trackFormatComparator Comparator used to order selected formats. |
241 | 245 | * @return This factory, for convenience. |
242 | 246 | */ |
| 247 | + @CanIgnoreReturnValue |
243 | 248 | public Factory setTrackFormatComparator(Comparator<Format> trackFormatComparator) { |
244 | 249 | this.trackFormatComparator = checkNotNull(trackFormatComparator); |
245 | 250 | return this; |
246 | 251 | } |
247 | 252 |
|
248 | | - /** Returns the comparator used to order formats in adaptive track selections. */ |
249 | | - protected final Comparator<Format> getTrackFormatComparator() { |
250 | | - return trackFormatComparator; |
251 | | - } |
252 | | - |
253 | 253 | @Override |
254 | 254 | public final @NullableType ExoTrackSelection[] createTrackSelections( |
255 | 255 | @NullableType Definition[] definitions, |
@@ -311,7 +311,7 @@ protected AdaptiveTrackSelection createAdaptiveTrackSelection( |
311 | 311 | bufferedFractionToLiveEdgeForQualityIncrease, |
312 | 312 | adaptationCheckpoints, |
313 | 313 | clock, |
314 | | - getTrackFormatComparator()); |
| 314 | + trackFormatComparator); |
315 | 315 | } |
316 | 316 | } |
317 | 317 |
|
|
0 commit comments