diff --git a/demos/main/src/main/java/com/google/android/exoplayer2/demo/SampleChooserActivity.java b/demos/main/src/main/java/com/google/android/exoplayer2/demo/SampleChooserActivity.java index 2aa134b114..1458d1a6b2 100644 --- a/demos/main/src/main/java/com/google/android/exoplayer2/demo/SampleChooserActivity.java +++ b/demos/main/src/main/java/com/google/android/exoplayer2/demo/SampleChooserActivity.java @@ -177,7 +177,7 @@ public class SampleChooserActivity extends AppCompatActivity groupPosition = preferences.getInt(GROUP_POSITION_PREFERENCE_KEY, /* defValue= */ -1); childPosition = preferences.getInt(CHILD_POSITION_PREFERENCE_KEY, /* defValue= */ -1); } catch (ClassCastException e) { - android.util.Log.w(TAG, "Saved position is not an int. Will not restore position.", e); + Log.w(TAG, "Saved position is not an int. Will not restore position.", e); } if (groupPosition != -1 && childPosition != -1) { sampleListView.expandGroup(groupPosition); // shouldExpandGroup does not work without this. diff --git a/library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java b/library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java index dd306c69d0..6e183ba811 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java @@ -1704,6 +1704,20 @@ public class SimpleExoPlayer extends BasePlayer } } + @SuppressWarnings("SuspiciousMethodCalls") + private void notifySkipSilenceEnabledChanged() { + for (AudioListener listener : audioListeners) { + // Prevent duplicate notification if a listener is both a AudioRendererEventListener and + // a AudioListener, as they have the same method signature. + if (!audioDebugListeners.contains(listener)) { + listener.onSkipSilenceEnabledChanged(skipSilenceEnabled); + } + } + for (AudioRendererEventListener listener : audioDebugListeners) { + listener.onSkipSilenceEnabledChanged(skipSilenceEnabled); + } + } + private void updatePlayWhenReady( boolean playWhenReady, @AudioFocusManager.PlayerCommand int playerCommand, @@ -1717,17 +1731,6 @@ public class SimpleExoPlayer extends BasePlayer player.setPlayWhenReady(playWhenReady, playbackSuppressionReason, playWhenReadyChangeReason); } - private void verifyApplicationThread() { - if (Looper.myLooper() != getApplicationLooper()) { - Log.w( - TAG, - "Player is accessed on the wrong thread. See " - + "https://exoplayer.dev/issues/player-accessed-on-wrong-thread", - hasNotifiedFullWrongThreadWarning ? null : new IllegalStateException()); - hasNotifiedFullWrongThreadWarning = true; - } - } - private void updateWakeAndWifiLock() { @State int playbackState = getPlaybackState(); switch (playbackState) { @@ -1746,26 +1749,23 @@ public class SimpleExoPlayer extends BasePlayer } } + private void verifyApplicationThread() { + if (Looper.myLooper() != getApplicationLooper()) { + Log.w( + TAG, + "Player is accessed on the wrong thread. See " + + "https://exoplayer.dev/issues/player-accessed-on-wrong-thread", + hasNotifiedFullWrongThreadWarning ? null : new IllegalStateException()); + hasNotifiedFullWrongThreadWarning = true; + } + } + private static int getPlayWhenReadyChangeReason(boolean playWhenReady, int playerCommand) { return playWhenReady && playerCommand != AudioFocusManager.PLAYER_COMMAND_PLAY_WHEN_READY ? PLAY_WHEN_READY_CHANGE_REASON_AUDIO_FOCUS_LOSS : PLAY_WHEN_READY_CHANGE_REASON_USER_REQUEST; } - @SuppressWarnings("SuspiciousMethodCalls") - private void notifySkipSilenceEnabledChanged() { - for (AudioListener listener : audioListeners) { - // Prevent duplicate notification if a listener is both a AudioRendererEventListener and - // a AudioListener, as they have the same method signature. - if (!audioDebugListeners.contains(listener)) { - listener.onSkipSilenceEnabledChanged(skipSilenceEnabled); - } - } - for (AudioRendererEventListener listener : audioDebugListeners) { - listener.onSkipSilenceEnabledChanged(skipSilenceEnabled); - } - } - private final class ComponentListener implements VideoRendererEventListener, AudioRendererEventListener, diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp3/Mp3Extractor.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp3/Mp3Extractor.java index 8967e0a230..b9613f38f5 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp3/Mp3Extractor.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp3/Mp3Extractor.java @@ -78,15 +78,15 @@ public final class Mp3Extractor implements Extractor { */ public static final int FLAG_ENABLE_CONSTANT_BITRATE_SEEKING = 1; /** - * Flag to force index seeking, consisting in building a time-to-byte mapping as the file is read. + * Flag to force index seeking, in which a time-to-byte mapping is built as the file is read. * *
This seeker may require to scan a significant portion of the file to compute a seek point. - * Therefore, it should only be used if: + * Therefore, it should only be used if one of the following is true: * *