From 151ea531b1f49b1b3684a54ce05da7a7b9d8fc1d Mon Sep 17 00:00:00 2001 From: krocard Date: Tue, 26 May 2020 15:28:57 +0100 Subject: [PATCH] Make constants more readable with _ separator Add an `_` in long constants. Eg: 10000 => 10_000. I'm proposing this change because I have had multiple missread due to confusing the number of 0 in a long number. More specifically, added an underscore to all number matching: `final.*\ [0-9]{2,}000;` PiperOrigin-RevId: 313186920 --- .../exoplayer2/ext/opus/OpusDecoder.java | 6 ++---- .../exoplayer2/DefaultControlDispatcher.java | 2 +- .../android/exoplayer2/DefaultLoadControl.java | 4 ++-- .../audio/AudioTrackPositionTracker.java | 4 ++-- .../exoplayer2/audio/DefaultAudioSink.java | 18 ++++++------------ .../source/ProgressiveMediaPeriod.java | 2 +- .../trackselection/AdaptiveTrackSelection.java | 6 +++--- .../DefaultLoadErrorHandlingPolicy.java | 2 +- .../video/VideoFrameReleaseTimeHelper.java | 2 +- .../video/spherical/CameraMotionRenderer.java | 2 +- .../video/spherical/ProjectionDecoder.java | 2 +- .../android/exoplayer2/ExoPlayerTest.java | 2 +- .../analytics/AnalyticsCollectorTest.java | 2 +- .../SilenceSkippingAudioProcessorTest.java | 2 +- .../source/ClippingMediaSourceTest.java | 4 ++-- .../source/dash/DashMediaSource.java | 4 ++-- .../extractor/mkv/MatroskaExtractor.java | 4 ++-- .../extractor/ogg/DefaultOggSeeker.java | 6 +++--- .../exoplayer2/extractor/ogg/OpusReader.java | 6 ++---- .../extractor/ts/PsBinarySearchSeeker.java | 2 +- .../extractor/ts/PsDurationReader.java | 2 +- .../source/smoothstreaming/SsMediaSource.java | 4 ++-- .../exoplayer2/testutil/DummyMainThread.java | 2 +- .../exoplayer2/testutil/FakeRenderer.java | 2 +- .../testutil/MediaSourceTestRunner.java | 2 +- .../exoplayer2/testutil/FakeClockTest.java | 2 +- 26 files changed, 43 insertions(+), 53 deletions(-) diff --git a/extensions/opus/src/main/java/com/google/android/exoplayer2/ext/opus/OpusDecoder.java b/extensions/opus/src/main/java/com/google/android/exoplayer2/ext/opus/OpusDecoder.java index 8795950671..c82636ca5a 100644 --- a/extensions/opus/src/main/java/com/google/android/exoplayer2/ext/opus/OpusDecoder.java +++ b/extensions/opus/src/main/java/com/google/android/exoplayer2/ext/opus/OpusDecoder.java @@ -36,10 +36,8 @@ import java.util.List; private static final int DEFAULT_SEEK_PRE_ROLL_SAMPLES = 3840; - /** - * Opus streams are always decoded at 48000 Hz. - */ - private static final int SAMPLE_RATE = 48000; + /** Opus streams are always decoded at 48000 Hz. */ + private static final int SAMPLE_RATE = 48_000; private static final int NO_ERROR = 0; private static final int DECODE_ERROR = -1; diff --git a/library/core/src/main/java/com/google/android/exoplayer2/DefaultControlDispatcher.java b/library/core/src/main/java/com/google/android/exoplayer2/DefaultControlDispatcher.java index 7f24e6113f..bc655d9a1b 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/DefaultControlDispatcher.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/DefaultControlDispatcher.java @@ -19,7 +19,7 @@ package com.google.android.exoplayer2; public class DefaultControlDispatcher implements ControlDispatcher { /** The default fast forward increment, in milliseconds. */ - public static final int DEFAULT_FAST_FORWARD_MS = 15000; + public static final int DEFAULT_FAST_FORWARD_MS = 15_000; /** The default rewind increment, in milliseconds. */ public static final int DEFAULT_REWIND_MS = 5000; diff --git a/library/core/src/main/java/com/google/android/exoplayer2/DefaultLoadControl.java b/library/core/src/main/java/com/google/android/exoplayer2/DefaultLoadControl.java index 5eb14021a3..3be234f3f9 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/DefaultLoadControl.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/DefaultLoadControl.java @@ -32,12 +32,12 @@ public class DefaultLoadControl implements LoadControl { * The default minimum duration of media that the player will attempt to ensure is buffered at all * times, in milliseconds. */ - public static final int DEFAULT_MIN_BUFFER_MS = 50000; + public static final int DEFAULT_MIN_BUFFER_MS = 50_000; /** * The default maximum duration of media that the player will attempt to buffer, in milliseconds. */ - public static final int DEFAULT_MAX_BUFFER_MS = 50000; + public static final int DEFAULT_MAX_BUFFER_MS = 50_000; /** * The default duration of media that must be buffered for playback to start or resume following a diff --git a/library/core/src/main/java/com/google/android/exoplayer2/audio/AudioTrackPositionTracker.java b/library/core/src/main/java/com/google/android/exoplayer2/audio/AudioTrackPositionTracker.java index 4ee70bd813..b3e232df22 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/audio/AudioTrackPositionTracker.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/audio/AudioTrackPositionTracker.java @@ -127,8 +127,8 @@ import java.lang.reflect.Method; private static final long FORCE_RESET_WORKAROUND_TIMEOUT_MS = 200; private static final int MAX_PLAYHEAD_OFFSET_COUNT = 10; - private static final int MIN_PLAYHEAD_OFFSET_SAMPLE_INTERVAL_US = 30000; - private static final int MIN_LATENCY_SAMPLE_INTERVAL_US = 500000; + private static final int MIN_PLAYHEAD_OFFSET_SAMPLE_INTERVAL_US = 30_000; + private static final int MIN_LATENCY_SAMPLE_INTERVAL_US = 50_0000; private final Listener listener; private final long[] playheadOffsets; diff --git a/library/core/src/main/java/com/google/android/exoplayer2/audio/DefaultAudioSink.java b/library/core/src/main/java/com/google/android/exoplayer2/audio/DefaultAudioSink.java index 6b06a7f678..27bbeb91f6 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/audio/DefaultAudioSink.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/audio/DefaultAudioSink.java @@ -198,18 +198,12 @@ public final class DefaultAudioSink implements AudioSink { } } - /** - * A minimum length for the {@link AudioTrack} buffer, in microseconds. - */ - private static final long MIN_BUFFER_DURATION_US = 250000; - /** - * A maximum length for the {@link AudioTrack} buffer, in microseconds. - */ - private static final long MAX_BUFFER_DURATION_US = 750000; - /** - * The length for passthrough {@link AudioTrack} buffers, in microseconds. - */ - private static final long PASSTHROUGH_BUFFER_DURATION_US = 250000; + /** A minimum length for the {@link AudioTrack} buffer, in microseconds. */ + private static final long MIN_BUFFER_DURATION_US = 250_000; + /** A maximum length for the {@link AudioTrack} buffer, in microseconds. */ + private static final long MAX_BUFFER_DURATION_US = 750_000; + /** The length for passthrough {@link AudioTrack} buffers, in microseconds. */ + private static final long PASSTHROUGH_BUFFER_DURATION_US = 250_000; /** * A multiplication factor to apply to the minimum buffer size requested by the underlying * {@link AudioTrack}. diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaPeriod.java b/library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaPeriod.java index 2630132044..0f5d2ce344 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaPeriod.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaPeriod.java @@ -89,7 +89,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; * When the source's duration is unknown, it is calculated by adding this value to the largest * sample timestamp seen when buffering completes. */ - private static final long DEFAULT_LAST_SAMPLE_DURATION_US = 10000; + private static final long DEFAULT_LAST_SAMPLE_DURATION_US = 10_000; private static final Map ICY_METADATA_HEADERS = createIcyMetadataHeaders(); diff --git a/library/core/src/main/java/com/google/android/exoplayer2/trackselection/AdaptiveTrackSelection.java b/library/core/src/main/java/com/google/android/exoplayer2/trackselection/AdaptiveTrackSelection.java index 9a599279ec..8b2bd4581c 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/trackselection/AdaptiveTrackSelection.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/trackselection/AdaptiveTrackSelection.java @@ -283,9 +283,9 @@ public class AdaptiveTrackSelection extends BaseTrackSelection { } } - public static final int DEFAULT_MIN_DURATION_FOR_QUALITY_INCREASE_MS = 10000; - public static final int DEFAULT_MAX_DURATION_FOR_QUALITY_DECREASE_MS = 25000; - public static final int DEFAULT_MIN_DURATION_TO_RETAIN_AFTER_DISCARD_MS = 25000; + public static final int DEFAULT_MIN_DURATION_FOR_QUALITY_INCREASE_MS = 10_000; + public static final int DEFAULT_MAX_DURATION_FOR_QUALITY_DECREASE_MS = 25_000; + public static final int DEFAULT_MIN_DURATION_TO_RETAIN_AFTER_DISCARD_MS = 25_000; public static final float DEFAULT_BANDWIDTH_FRACTION = 0.7f; public static final float DEFAULT_BUFFERED_FRACTION_TO_LIVE_EDGE_FOR_QUALITY_INCREASE = 0.75f; public static final long DEFAULT_MIN_TIME_BETWEEN_BUFFER_REEVALUTATION_MS = 2000; diff --git a/library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicy.java b/library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicy.java index a5e30b5ccc..b623d7bfe1 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicy.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicy.java @@ -33,7 +33,7 @@ public class DefaultLoadErrorHandlingPolicy implements LoadErrorHandlingPolicy { */ public static final int DEFAULT_MIN_LOADABLE_RETRY_COUNT_PROGRESSIVE_LIVE = 6; /** The default duration for which a track is blacklisted in milliseconds. */ - public static final long DEFAULT_TRACK_BLACKLIST_MS = 60000; + public static final long DEFAULT_TRACK_BLACKLIST_MS = 60_000; private static final int DEFAULT_BEHAVIOR_MIN_LOADABLE_RETRY_COUNT = -1; diff --git a/library/core/src/main/java/com/google/android/exoplayer2/video/VideoFrameReleaseTimeHelper.java b/library/core/src/main/java/com/google/android/exoplayer2/video/VideoFrameReleaseTimeHelper.java index 2134772d9c..01b296e747 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/video/VideoFrameReleaseTimeHelper.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/video/VideoFrameReleaseTimeHelper.java @@ -36,7 +36,7 @@ import com.google.android.exoplayer2.util.Util; public final class VideoFrameReleaseTimeHelper { private static final long CHOREOGRAPHER_SAMPLE_DELAY_MILLIS = 500; - private static final long MAX_ALLOWED_DRIFT_NS = 20000000; + private static final long MAX_ALLOWED_DRIFT_NS = 20_000_000; private static final long VSYNC_OFFSET_PERCENTAGE = 80; private static final int MIN_FRAMES_FOR_ADJUSTMENT = 6; diff --git a/library/core/src/main/java/com/google/android/exoplayer2/video/spherical/CameraMotionRenderer.java b/library/core/src/main/java/com/google/android/exoplayer2/video/spherical/CameraMotionRenderer.java index abf08f3b4e..1960a4b534 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/video/spherical/CameraMotionRenderer.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/video/spherical/CameraMotionRenderer.java @@ -35,7 +35,7 @@ public class CameraMotionRenderer extends BaseRenderer { private static final String TAG = "CameraMotionRenderer"; // The amount of time to read samples ahead of the current time. - private static final int SAMPLE_WINDOW_DURATION_US = 100000; + private static final int SAMPLE_WINDOW_DURATION_US = 100_000; private final DecoderInputBuffer buffer; private final ParsableByteArray scratch; diff --git a/library/core/src/main/java/com/google/android/exoplayer2/video/spherical/ProjectionDecoder.java b/library/core/src/main/java/com/google/android/exoplayer2/video/spherical/ProjectionDecoder.java index eadc617ea7..c5a1a76895 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/video/spherical/ProjectionDecoder.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/video/spherical/ProjectionDecoder.java @@ -45,7 +45,7 @@ public final class ProjectionDecoder { // Sanity limits to prevent a bad file from creating an OOM situation. We don't expect a mesh to // exceed these limits. - private static final int MAX_COORDINATE_COUNT = 10000; + private static final int MAX_COORDINATE_COUNT = 10_000; private static final int MAX_VERTEX_COUNT = 32 * 1000; private static final int MAX_TRIANGLE_INDICES = 128 * 1000; diff --git a/library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java b/library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java index ad95fb11c7..788852ed98 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java @@ -118,7 +118,7 @@ public final class ExoPlayerTest { * milliseconds after starting the player before the test will time out. This is to catch cases * where the player under test is not making progress, in which case the test should fail. */ - private static final int TIMEOUT_MS = 10000; + private static final int TIMEOUT_MS = 10_000; private Context context; private Timeline dummyTimeline; diff --git a/library/core/src/test/java/com/google/android/exoplayer2/analytics/AnalyticsCollectorTest.java b/library/core/src/test/java/com/google/android/exoplayer2/analytics/AnalyticsCollectorTest.java index 74b83d7873..8a0ee105b6 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/analytics/AnalyticsCollectorTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/analytics/AnalyticsCollectorTest.java @@ -134,7 +134,7 @@ public final class AnalyticsCollectorTest { private static final Format VIDEO_FORMAT_DRM_1 = ExoPlayerTestRunner.VIDEO_FORMAT.buildUpon().setDrmInitData(DRM_DATA_1).build(); - private static final int TIMEOUT_MS = 10000; + private static final int TIMEOUT_MS = 10_000; private static final Timeline SINGLE_PERIOD_TIMELINE = new FakeTimeline(/* windowCount= */ 1); private static final EventWindowAndPeriodId WINDOW_0 = new EventWindowAndPeriodId(/* windowIndex= */ 0, /* mediaPeriodId= */ null); diff --git a/library/core/src/test/java/com/google/android/exoplayer2/audio/SilenceSkippingAudioProcessorTest.java b/library/core/src/test/java/com/google/android/exoplayer2/audio/SilenceSkippingAudioProcessorTest.java index 1a78788f05..9fc9b12c02 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/audio/SilenceSkippingAudioProcessorTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/audio/SilenceSkippingAudioProcessorTest.java @@ -37,7 +37,7 @@ public final class SilenceSkippingAudioProcessorTest { /* sampleRate= */ 1000, /* channelCount= */ 2, /* encoding= */ C.ENCODING_PCM_16BIT); private static final int TEST_SIGNAL_SILENCE_DURATION_MS = 1000; private static final int TEST_SIGNAL_NOISE_DURATION_MS = 1000; - private static final int TEST_SIGNAL_FRAME_COUNT = 100000; + private static final int TEST_SIGNAL_FRAME_COUNT = 100_000; private static final int INPUT_BUFFER_SIZE = 100; diff --git a/library/core/src/test/java/com/google/android/exoplayer2/source/ClippingMediaSourceTest.java b/library/core/src/test/java/com/google/android/exoplayer2/source/ClippingMediaSourceTest.java index c371ec0451..5d47eec430 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/source/ClippingMediaSourceTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/source/ClippingMediaSourceTest.java @@ -51,8 +51,8 @@ import org.robolectric.annotation.LooperMode.Mode; @LooperMode(Mode.PAUSED) public final class ClippingMediaSourceTest { - private static final long TEST_PERIOD_DURATION_US = 1000000; - private static final long TEST_CLIP_AMOUNT_US = 300000; + private static final long TEST_PERIOD_DURATION_US = 1_000_000; + private static final long TEST_CLIP_AMOUNT_US = 300_000; private Window window; private Period period; diff --git a/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DashMediaSource.java b/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DashMediaSource.java index fe74eff210..03d967e895 100644 --- a/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DashMediaSource.java +++ b/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DashMediaSource.java @@ -411,7 +411,7 @@ public final class DashMediaSource extends BaseMediaSource { * The default presentation delay for live streams. The presentation delay is the duration by * which the default start position precedes the end of the live window. */ - public static final long DEFAULT_LIVE_PRESENTATION_DELAY_MS = 30000; + public static final long DEFAULT_LIVE_PRESENTATION_DELAY_MS = 30_000; /** @deprecated Use {@link #DEFAULT_LIVE_PRESENTATION_DELAY_MS}. */ @Deprecated public static final long DEFAULT_LIVE_PRESENTATION_DELAY_FIXED_MS = @@ -432,7 +432,7 @@ public final class DashMediaSource extends BaseMediaSource { /** * The minimum default start position for live streams, relative to the start of the live window. */ - private static final long MIN_LIVE_DEFAULT_START_POSITION_US = 5000000; + private static final long MIN_LIVE_DEFAULT_START_POSITION_US = 5_000_000; private static final String TAG = "DashMediaSource"; diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java index 8bb057d404..6d28e870a4 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java @@ -299,7 +299,7 @@ public class MatroskaExtractor implements Extractor { * The value by which to divide a time in microseconds to convert it to the unit of the last value * in an SSA timecode (1/100ths of a second). */ - private static final long SSA_TIMECODE_LAST_VALUE_SCALING_FACTOR = 10000; + private static final long SSA_TIMECODE_LAST_VALUE_SCALING_FACTOR = 10_000; /** * The format of an SSA timecode. */ @@ -1861,7 +1861,7 @@ public class MatroskaExtractor implements Extractor { private static final class Track { private static final int DISPLAY_UNIT_PIXELS = 0; - private static final int MAX_CHROMATICITY = 50000; // Defined in CTA-861.3. + private static final int MAX_CHROMATICITY = 50_000; // Defined in CTA-861.3. /** * Default max content light level (CLL) that should be encoded into hdrStaticInfo. */ diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ogg/DefaultOggSeeker.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ogg/DefaultOggSeeker.java index 1d73a1b66a..b7d86632fb 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ogg/DefaultOggSeeker.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ogg/DefaultOggSeeker.java @@ -30,9 +30,9 @@ import java.io.IOException; /** Seeks in an Ogg stream. */ /* package */ final class DefaultOggSeeker implements OggSeeker { - private static final int MATCH_RANGE = 72000; - private static final int MATCH_BYTE_RANGE = 100000; - private static final int DEFAULT_OFFSET = 30000; + private static final int MATCH_RANGE = 72_000; + private static final int MATCH_BYTE_RANGE = 100_000; + private static final int DEFAULT_OFFSET = 30_000; private static final int STATE_SEEK_TO_END = 0; private static final int STATE_READ_LAST_PAGE = 1; diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ogg/OpusReader.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ogg/OpusReader.java index 018fd949b3..9fe9ca36e6 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ogg/OpusReader.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ogg/OpusReader.java @@ -32,10 +32,8 @@ import java.util.List; private static final int DEFAULT_SEEK_PRE_ROLL_SAMPLES = 3840; - /** - * Opus streams are always decoded at 48000 Hz. - */ - private static final int SAMPLE_RATE = 48000; + /** Opus streams are always decoded at 48000 Hz. */ + private static final int SAMPLE_RATE = 48_000; private static final int OPUS_CODE = 0x4f707573; private static final byte[] OPUS_SIGNATURE = {'O', 'p', 'u', 's', 'H', 'e', 'a', 'd'}; diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ts/PsBinarySearchSeeker.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ts/PsBinarySearchSeeker.java index 09cf9b3f00..0973219804 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ts/PsBinarySearchSeeker.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ts/PsBinarySearchSeeker.java @@ -35,7 +35,7 @@ import java.io.IOException; private static final long SEEK_TOLERANCE_US = 100_000; private static final int MINIMUM_SEARCH_RANGE_BYTES = 1000; - private static final int TIMESTAMP_SEARCH_BYTES = 20000; + private static final int TIMESTAMP_SEARCH_BYTES = 20_000; public PsBinarySearchSeeker( TimestampAdjuster scrTimestampAdjuster, long streamDurationUs, long inputLength) { diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ts/PsDurationReader.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ts/PsDurationReader.java index 4748b832de..0a74e92ce0 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ts/PsDurationReader.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ts/PsDurationReader.java @@ -39,7 +39,7 @@ import java.io.IOException; */ /* package */ final class PsDurationReader { - private static final int TIMESTAMP_SEARCH_BYTES = 20000; + private static final int TIMESTAMP_SEARCH_BYTES = 20_000; private final TimestampAdjuster scrTimestampAdjuster; private final ParsableByteArray packetBuffer; diff --git a/library/smoothstreaming/src/main/java/com/google/android/exoplayer2/source/smoothstreaming/SsMediaSource.java b/library/smoothstreaming/src/main/java/com/google/android/exoplayer2/source/smoothstreaming/SsMediaSource.java index 03506284ec..24e835ee90 100644 --- a/library/smoothstreaming/src/main/java/com/google/android/exoplayer2/source/smoothstreaming/SsMediaSource.java +++ b/library/smoothstreaming/src/main/java/com/google/android/exoplayer2/source/smoothstreaming/SsMediaSource.java @@ -330,7 +330,7 @@ public final class SsMediaSource extends BaseMediaSource * The default presentation delay for live streams. The presentation delay is the duration by * which the default start position precedes the end of the live window. */ - public static final long DEFAULT_LIVE_PRESENTATION_DELAY_MS = 30000; + public static final long DEFAULT_LIVE_PRESENTATION_DELAY_MS = 30_000; /** * The minimum period between manifest refreshes. @@ -339,7 +339,7 @@ public final class SsMediaSource extends BaseMediaSource /** * The minimum default start position for live streams, relative to the start of the live window. */ - private static final long MIN_LIVE_DEFAULT_START_POSITION_US = 5000000; + private static final long MIN_LIVE_DEFAULT_START_POSITION_US = 5_000_000; private final boolean sideloadedManifest; private final Uri manifestUri; diff --git a/testutils/src/main/java/com/google/android/exoplayer2/testutil/DummyMainThread.java b/testutils/src/main/java/com/google/android/exoplayer2/testutil/DummyMainThread.java index 9678e03b40..9121d35f59 100644 --- a/testutils/src/main/java/com/google/android/exoplayer2/testutil/DummyMainThread.java +++ b/testutils/src/main/java/com/google/android/exoplayer2/testutil/DummyMainThread.java @@ -34,7 +34,7 @@ public final class DummyMainThread { } /** Default timeout value used for {@link #runOnMainThread(Runnable)}. */ - public static final int TIMEOUT_MS = 10000; + public static final int TIMEOUT_MS = 10_000; private final HandlerThread thread; private final Handler handler; diff --git a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeRenderer.java b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeRenderer.java index e2e6e2e27a..e4f96e0147 100644 --- a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeRenderer.java +++ b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeRenderer.java @@ -46,7 +46,7 @@ public class FakeRenderer extends BaseRenderer { * source. A real renderer will typically read ahead by a small amount due to pipelining through * decoders and the media output path. */ - private static final long SOURCE_READAHEAD_US = 250000; + private static final long SOURCE_READAHEAD_US = 250_000; private final DecoderInputBuffer buffer; diff --git a/testutils/src/main/java/com/google/android/exoplayer2/testutil/MediaSourceTestRunner.java b/testutils/src/main/java/com/google/android/exoplayer2/testutil/MediaSourceTestRunner.java index 610995b53a..19fbb51b33 100644 --- a/testutils/src/main/java/com/google/android/exoplayer2/testutil/MediaSourceTestRunner.java +++ b/testutils/src/main/java/com/google/android/exoplayer2/testutil/MediaSourceTestRunner.java @@ -49,7 +49,7 @@ import java.util.concurrent.atomic.AtomicReference; /** A runner for {@link MediaSource} tests. */ public class MediaSourceTestRunner { - public static final int TIMEOUT_MS = 10000; + public static final int TIMEOUT_MS = 10_000; private final MediaSource mediaSource; private final MediaSourceListener mediaSourceListener; diff --git a/testutils/src/test/java/com/google/android/exoplayer2/testutil/FakeClockTest.java b/testutils/src/test/java/com/google/android/exoplayer2/testutil/FakeClockTest.java index 41cbf8ae15..b0511f8aba 100644 --- a/testutils/src/test/java/com/google/android/exoplayer2/testutil/FakeClockTest.java +++ b/testutils/src/test/java/com/google/android/exoplayer2/testutil/FakeClockTest.java @@ -33,7 +33,7 @@ import org.robolectric.annotation.LooperMode; @LooperMode(LooperMode.Mode.PAUSED) public final class FakeClockTest { - private static final long TIMEOUT_MS = 10000; + private static final long TIMEOUT_MS = 10_000; @Test public void currentTimeMillis_withoutBootTime() {