diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/AdaptiveTrackSelection.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/AdaptiveTrackSelection.java index 708276a7c4..993c50a24e 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/AdaptiveTrackSelection.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/AdaptiveTrackSelection.java @@ -411,7 +411,7 @@ public class AdaptiveTrackSelection extends BaseTrackSelection { playbackSpeed = 1f; reason = C.SELECTION_REASON_UNKNOWN; lastBufferEvaluationMs = C.TIME_UNSET; - latestBitrateEstimate = Long.MIN_VALUE; + latestBitrateEstimate = C.RATE_UNSET_INT; } @CallSuper diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/ExoTrackSelection.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/ExoTrackSelection.java index 1ddefeb300..1ccb5ee20c 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/ExoTrackSelection.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/ExoTrackSelection.java @@ -296,10 +296,10 @@ public interface ExoTrackSelection extends TrackSelection { /** * Returns the most recent bitrate estimate utilised for track selection. * - *

The default behavior is to return {@link Long#MIN_VALUE}, indicating that the bitrate + *

The default behavior is to return {@link C#RATE_UNSET_INT}, indicating that the bitrate * estimate was not computed for the track selection decision. */ default long getLatestBitrateEstimate() { - return Long.MIN_VALUE; + return C.RATE_UNSET_INT; } } diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/upstream/CmcdHeadersFactory.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/upstream/CmcdHeadersFactory.java index d09f52983f..24e7d52858 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/upstream/CmcdHeadersFactory.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/upstream/CmcdHeadersFactory.java @@ -242,7 +242,7 @@ public final class CmcdHeadersFactory { cmcdRequest.setBufferLengthMs(Util.usToMs(bufferedDurationUs)); } if (cmcdConfiguration.isMeasuredThroughputLoggingAllowed() - && trackSelection.getLatestBitrateEstimate() != Long.MIN_VALUE) { + && trackSelection.getLatestBitrateEstimate() != C.RATE_UNSET_INT) { cmcdRequest.setMeasuredThroughputInKbps( Util.ceilDivide(trackSelection.getLatestBitrateEstimate(), 1000)); } @@ -471,7 +471,7 @@ public final class CmcdHeadersFactory { /** Creates a new instance with default values. */ public Builder() { this.bufferLengthMs = C.TIME_UNSET; - this.measuredThroughputInKbps = Long.MIN_VALUE; + this.measuredThroughputInKbps = C.RATE_UNSET_INT; this.deadlineMs = C.TIME_UNSET; } @@ -491,14 +491,15 @@ public final class CmcdHeadersFactory { /** * Sets the {@link CmcdRequest#measuredThroughputInKbps}. Rounded to nearest 100 kbps. The - * default value is {@link Long#MIN_VALUE}. + * default value is {@link C#RATE_UNSET_INT}. * * @throws IllegalArgumentException If {@code measuredThroughputInKbps} is not equal to {@link - * Long#MIN_VALUE} and is negative. + * C#RATE_UNSET_INT} and is negative. */ @CanIgnoreReturnValue public Builder setMeasuredThroughputInKbps(long measuredThroughputInKbps) { - checkArgument(measuredThroughputInKbps >= 0 || measuredThroughputInKbps == Long.MIN_VALUE); + checkArgument( + measuredThroughputInKbps >= 0 || measuredThroughputInKbps == C.RATE_UNSET_INT); this.measuredThroughputInKbps = ((measuredThroughputInKbps + 50) / 100) * 100; return this; @@ -551,7 +552,7 @@ public final class CmcdHeadersFactory { /** * The throughput between client and server, as measured by the client, or {@link - * Long#MIN_VALUE} if unset. + * C#RATE_UNSET_INT} if unset. * *

This value MUST be rounded to the nearest 100 kbps. This value, however derived, SHOULD be * the value that the client is using to make its next Adaptive Bitrate switching decision. If @@ -607,7 +608,7 @@ public final class CmcdHeadersFactory { if (bufferLengthMs != C.TIME_UNSET) { headerValueList.add(CmcdConfiguration.KEY_BUFFER_LENGTH + "=" + bufferLengthMs); } - if (measuredThroughputInKbps != Long.MIN_VALUE) { + if (measuredThroughputInKbps != C.RATE_UNSET_INT) { headerValueList.add( CmcdConfiguration.KEY_MEASURED_THROUGHPUT + "=" + measuredThroughputInKbps); }