diff --git a/library/src/main/java/com/google/android/exoplayer2/C.java b/library/src/main/java/com/google/android/exoplayer2/C.java index 4f3e462dec..ec7e6fa3de 100644 --- a/library/src/main/java/com/google/android/exoplayer2/C.java +++ b/library/src/main/java/com/google/android/exoplayer2/C.java @@ -548,6 +548,11 @@ public final class C { */ public static final int STEREO_MODE_STEREO_MESH = 3; + /** + * Priority for media playback. + */ + public static final int PRIORITY_PLAYBACK = 0; + /** * Converts a time in microseconds to the corresponding time in milliseconds, preserving * {@link #TIME_UNSET} values. diff --git a/library/src/main/java/com/google/android/exoplayer2/DefaultLoadControl.java b/library/src/main/java/com/google/android/exoplayer2/DefaultLoadControl.java index fe7015a942..d8bc042ad7 100644 --- a/library/src/main/java/com/google/android/exoplayer2/DefaultLoadControl.java +++ b/library/src/main/java/com/google/android/exoplayer2/DefaultLoadControl.java @@ -51,11 +51,6 @@ public final class DefaultLoadControl implements LoadControl { */ public static final int DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS = 5000; - /** - * Priority for media loading. - */ - public static final int LOADING_PRIORITY = 0; - private static final int ABOVE_HIGH_WATERMARK = 0; private static final int BETWEEN_WATERMARKS = 1; private static final int BELOW_LOW_WATERMARK = 2; @@ -122,7 +117,7 @@ public final class DefaultLoadControl implements LoadControl { * playback to resume after a rebuffer, in milliseconds. A rebuffer is defined to be caused by * buffer depletion rather than a user action. * @param priorityTaskManager If not null, registers itself as a task with priority - * {@link #LOADING_PRIORITY} during loading periods, and unregisters itself during draining + * {@link C#PRIORITY_PLAYBACK} during loading periods, and unregisters itself during draining * periods. */ public DefaultLoadControl(DefaultAllocator allocator, int minBufferMs, int maxBufferMs, @@ -183,9 +178,9 @@ public final class DefaultLoadControl implements LoadControl { || (bufferTimeState == BETWEEN_WATERMARKS && isBuffering && !targetBufferSizeReached); if (priorityTaskManager != null && isBuffering != wasBuffering) { if (isBuffering) { - priorityTaskManager.add(LOADING_PRIORITY); + priorityTaskManager.add(C.PRIORITY_PLAYBACK); } else { - priorityTaskManager.remove(LOADING_PRIORITY); + priorityTaskManager.remove(C.PRIORITY_PLAYBACK); } } return isBuffering; @@ -199,7 +194,7 @@ public final class DefaultLoadControl implements LoadControl { private void reset(boolean resetAllocator) { targetBufferSize = 0; if (priorityTaskManager != null && isBuffering) { - priorityTaskManager.remove(LOADING_PRIORITY); + priorityTaskManager.remove(C.PRIORITY_PLAYBACK); } isBuffering = false; if (resetAllocator) {