From e21dd748d3e7ac95ef20a33955fd5bc662140f6e Mon Sep 17 00:00:00 2001 From: Filip Czaplicki Date: Thu, 25 Jul 2024 23:25:00 +0200 Subject: [PATCH] Fix typos --- .../androidtv/auth/model/QuickConnectState.kt | 2 +- .../auth/repository/ServerRepository.kt | 6 +++--- .../androidtv/preference/UserPreferences.kt | 2 +- .../androidtv/ui/ScreensaverViewModel.kt | 2 +- .../ui/browsing/BrowseGridFragment.java | 18 ++++++++--------- .../ui/card/LegacyImageCardView.java | 4 ++-- .../ui/home/HomeFragmentLatestRow.kt | 4 ++-- .../ui/livetv/LiveTvGuideFragment.java | 4 ++-- .../androidtv/ui/livetv/TvManager.java | 2 +- .../ui/navigation/NavigationAction.kt | 2 +- .../ui/picture/PictureViewerFragment.kt | 2 +- .../CustomPlaybackOverlayFragment.java | 6 +++--- .../ui/playback/PlaybackController.java | 2 +- .../presentation/HorizontalGridPresenter.java | 2 +- .../ui/presentation/MutableObjectAdapter.kt | 2 +- .../androidtv/ui/startup/StartupViewModel.kt | 2 +- .../startup/fragment/SelectServerFragment.kt | 2 +- .../jellyfin/androidtv/util/KeyProcessor.java | 2 +- ...rocesorHelper.kt => KeyProcessorHelper.kt} | 0 .../ui/playback/VideoSpeedControllerTests.kt | 2 +- app/src/test/kotlin/util/TimeUtilsTests.kt | 2 +- playback/core/src/main/kotlin/PlayerState.kt | 2 +- .../core/src/main/kotlin/PlayerVolumeState.kt | 20 +++++++++---------- .../src/main/kotlin/ExoPlayerAudioPipeline.kt | 2 +- 24 files changed, 47 insertions(+), 47 deletions(-) rename app/src/main/java/org/jellyfin/androidtv/util/{KeyProcesorHelper.kt => KeyProcessorHelper.kt} (100%) diff --git a/app/src/main/java/org/jellyfin/androidtv/auth/model/QuickConnectState.kt b/app/src/main/java/org/jellyfin/androidtv/auth/model/QuickConnectState.kt index bc1a701a69..78b1f6f548 100644 --- a/app/src/main/java/org/jellyfin/androidtv/auth/model/QuickConnectState.kt +++ b/app/src/main/java/org/jellyfin/androidtv/auth/model/QuickConnectState.kt @@ -3,7 +3,7 @@ package org.jellyfin.androidtv.auth.model sealed class QuickConnectState /** - * State unknown untill first poll completed. + * State unknown until first poll completed. */ data object UnknownQuickConnectState : QuickConnectState() diff --git a/app/src/main/java/org/jellyfin/androidtv/auth/repository/ServerRepository.kt b/app/src/main/java/org/jellyfin/androidtv/auth/repository/ServerRepository.kt index 88607c9c50..848f181aed 100644 --- a/app/src/main/java/org/jellyfin/androidtv/auth/repository/ServerRepository.kt +++ b/app/src/main/java/org/jellyfin/androidtv/auth/repository/ServerRepository.kt @@ -95,7 +95,7 @@ class ServerRepositoryImpl( val goodRecommendations = mutableListOf() val badRecommendations = mutableListOf() - val greatRecommendaton = jellyfin.discovery.getRecommendedServers(addressCandidates).firstOrNull { recommendedServer -> + val greatRecommendation = jellyfin.discovery.getRecommendedServers(addressCandidates).firstOrNull { recommendedServer -> when (recommendedServer.score) { RecommendedServerInfoScore.GREAT -> true RecommendedServerInfoScore.GOOD -> { @@ -111,7 +111,7 @@ class ServerRepositoryImpl( Timber.d(buildString { append("Recommendations: ") - if (greatRecommendaton == null) append(0) + if (greatRecommendation == null) append(0) else append(1) append(" great, ") append(goodRecommendations.size) @@ -120,7 +120,7 @@ class ServerRepositoryImpl( append(" bad") }) - val chosenRecommendation = greatRecommendaton ?: goodRecommendations.firstOrNull() + val chosenRecommendation = greatRecommendation ?: goodRecommendations.firstOrNull() if (chosenRecommendation != null && chosenRecommendation.systemInfo.isSuccess) { // Get system info val systemInfo = chosenRecommendation.systemInfo.getOrThrow() diff --git a/app/src/main/java/org/jellyfin/androidtv/preference/UserPreferences.kt b/app/src/main/java/org/jellyfin/androidtv/preference/UserPreferences.kt index a630ebdeed..73de522aac 100644 --- a/app/src/main/java/org/jellyfin/androidtv/preference/UserPreferences.kt +++ b/app/src/main/java/org/jellyfin/androidtv/preference/UserPreferences.kt @@ -45,7 +45,7 @@ class UserPreferences(context: Context) : SharedPreferenceStore( var premieresEnabled = booleanPreference("pref_enable_premieres", false) /** - * Enable management of media like deleting items when the user has sufficient permisisons. + * Enable management of media like deleting items when the user has sufficient permissions. */ var mediaManagementEnabled = booleanPreference("enable_media_management", false) diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/ScreensaverViewModel.kt b/app/src/main/java/org/jellyfin/androidtv/ui/ScreensaverViewModel.kt index e5d63fce7d..a075563a7c 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/ScreensaverViewModel.kt +++ b/app/src/main/java/org/jellyfin/androidtv/ui/ScreensaverViewModel.kt @@ -46,7 +46,7 @@ class ScreensaverViewModel( // Cancel pending timer (if any) timer?.cancel() - // Hide when interacted with allowed cancelation or when disabled + // Hide when interacted with allowed cancellation or when disabled if (_visible.value && (canCancel || !inAppEnabled || activityPaused)) { _visible.value = false } diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/browsing/BrowseGridFragment.java b/app/src/main/java/org/jellyfin/androidtv/ui/browsing/BrowseGridFragment.java index aa30d2b45c..2d6125cce8 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/browsing/BrowseGridFragment.java +++ b/app/src/main/java/org/jellyfin/androidtv/ui/browsing/BrowseGridFragment.java @@ -473,11 +473,11 @@ private void setAutoCardGridValues() { if (numRows > 0) { double paddingPct = cardScaling / numRows; - double spaceingPct = ((paddingPct / 2.0) * CARD_SPACING_PCT) * (numRows - 1); + double spacingPct = ((paddingPct / 2.0) * CARD_SPACING_PCT) * (numRows - 1); - double wastedSpacePct = paddingPct + spaceingPct; - double useableCardSpace = mGridHeight / (1.0 + wastedSpacePct); // decrease size - double cardHeight = useableCardSpace / numRows; + double wastedSpacePct = paddingPct + spacingPct; + double usableCardSpace = mGridHeight / (1.0 + wastedSpacePct); // decrease size + double cardHeight = usableCardSpace / numRows; // fix any rounding errors and make pixel perfect cardHeightInt = (int) Math.round(cardHeight); @@ -501,14 +501,14 @@ private void setAutoCardGridValues() { mCardsScreenStride = numRows; } else if (numCols > 0) { double paddingPct = cardScaling / numCols; - double spaceingPct = ((paddingPct / 2.0) * CARD_SPACING_PCT) * (numCols - 1); + double spacingPct = ((paddingPct / 2.0) * CARD_SPACING_PCT) * (numCols - 1); if (mImageType == ImageType.BANNER) { - spaceingPct = ((paddingPct / 2.0) * CARD_SPACING_HORIZONTAL_BANNER_PCT) * (numCols - 1); + spacingPct = ((paddingPct / 2.0) * CARD_SPACING_HORIZONTAL_BANNER_PCT) * (numCols - 1); } - double wastedSpacePct = paddingPct + spaceingPct; - double useableCardSpace = mGridWidth / (1.0 + wastedSpacePct); // decrease size - double cardWidth = useableCardSpace / numCols; + double wastedSpacePct = paddingPct + spacingPct; + double usableCardSpace = mGridWidth / (1.0 + wastedSpacePct); // decrease size + double cardWidth = usableCardSpace / numCols; // fix any rounding errors and make pixel perfect cardHeightInt = (int) Math.round(getCardHeightBy(cardWidth, mImageType, mFolder)); diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/card/LegacyImageCardView.java b/app/src/main/java/org/jellyfin/androidtv/ui/card/LegacyImageCardView.java index d52c42d822..2db9fa047e 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/card/LegacyImageCardView.java +++ b/app/src/main/java/org/jellyfin/androidtv/ui/card/LegacyImageCardView.java @@ -158,7 +158,7 @@ public void insertCardData (@Nullable String fullName, @NonNull int icon, @NonNu } } - public CharSequence gettitle() { + public CharSequence getTitle() { if (binding.title == null) { return null; } @@ -212,7 +212,7 @@ public boolean hasOverlappingRendering() { } private void setTextMaxLines() { - if (TextUtils.isEmpty(gettitle())) { + if (TextUtils.isEmpty(getTitle())) { binding.contentText.setMaxLines(2); } else { binding.contentText.setMaxLines(1); diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/home/HomeFragmentLatestRow.kt b/app/src/main/java/org/jellyfin/androidtv/ui/home/HomeFragmentLatestRow.kt index 6461a8c302..0dabcc6dd3 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/home/HomeFragmentLatestRow.kt +++ b/app/src/main/java/org/jellyfin/androidtv/ui/home/HomeFragmentLatestRow.kt @@ -52,7 +52,7 @@ class HomeFragmentLatestRow( } companion object { - // Collections exclused from latest row based on app support and common sense + // Collections excluded from latest row based on app support and common sense private val EXCLUDED_COLLECTION_TYPES = arrayOf( CollectionType.PLAYLISTS, CollectionType.LIVETV, @@ -60,7 +60,7 @@ class HomeFragmentLatestRow( CollectionType.BOOKS, ) - // Maximum ammount of items loaded for a row + // Maximum amount of items loaded for a row private const val ITEM_LIMIT = 50 } } diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/livetv/LiveTvGuideFragment.java b/app/src/main/java/org/jellyfin/androidtv/ui/livetv/LiveTvGuideFragment.java index e72af04b03..4649270dd0 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/livetv/LiveTvGuideFragment.java +++ b/app/src/main/java/org/jellyfin/androidtv/ui/livetv/LiveTvGuideFragment.java @@ -538,8 +538,8 @@ protected Void doInBackground(Integer... params) { // set focus parameters if we are not on first row // this makes focus movements more predictable for the grid view if (prevRow != null) { - TvManager.setFocusParms(row, prevRow, true); - TvManager.setFocusParms(prevRow, row, false); + TvManager.setFocusParams(row, prevRow, true); + TvManager.setFocusParams(prevRow, row, false); } prevRow = row; diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/livetv/TvManager.java b/app/src/main/java/org/jellyfin/androidtv/ui/livetv/TvManager.java index ca5838adde..a63af5e675 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/livetv/TvManager.java +++ b/app/src/main/java/org/jellyfin/androidtv/ui/livetv/TvManager.java @@ -204,7 +204,7 @@ public static void setTimelineRow(Context context, LinearLayout timelineRow, Bas } // this makes focus movements more predictable for the grid view - public static void setFocusParms(LinearLayout currentRow, LinearLayout otherRow, boolean up) { + public static void setFocusParams(LinearLayout currentRow, LinearLayout otherRow, boolean up) { for (int currentRowNdx = 0; currentRowNdx < currentRow.getChildCount(); currentRowNdx++) { ProgramGridCell cell = (ProgramGridCell) currentRow.getChildAt(currentRowNdx); ProgramGridCell otherCell = getOtherCell(otherRow, cell); diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/navigation/NavigationAction.kt b/app/src/main/java/org/jellyfin/androidtv/ui/navigation/NavigationAction.kt index 40f64e8f8d..e3c17ae605 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/navigation/NavigationAction.kt +++ b/app/src/main/java/org/jellyfin/androidtv/ui/navigation/NavigationAction.kt @@ -15,7 +15,7 @@ sealed interface NavigationAction { ) : NavigationAction /** - * Open the activity in [destination] and immediatly call [onOpened] to clear the emitted state. + * Open the activity in [destination] and immediately call [onOpened] to clear the emitted state. */ data class NavigateActivity( val destination: Destination.Activity, diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/picture/PictureViewerFragment.kt b/app/src/main/java/org/jellyfin/androidtv/ui/picture/PictureViewerFragment.kt index 4cfe8c3bd8..851b9a2b81 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/picture/PictureViewerFragment.kt +++ b/app/src/main/java/org/jellyfin/androidtv/ui/picture/PictureViewerFragment.kt @@ -201,7 +201,7 @@ class PictureViewerFragment : Fragment(), View.OnKeyListener { actionHideTimer = lifecycleScope.launch { delay(AUTO_HIDE_ACTIONS_DURATION) - // Only auto-hide when there is an active presenation + // Only auto-hide when there is an active presentation if (pictureViewerViewModel.presentationActive.value) hideActions() } } diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/playback/CustomPlaybackOverlayFragment.java b/app/src/main/java/org/jellyfin/androidtv/ui/playback/CustomPlaybackOverlayFragment.java index 04062fb2b1..551bedf787 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/playback/CustomPlaybackOverlayFragment.java +++ b/app/src/main/java/org/jellyfin/androidtv/ui/playback/CustomPlaybackOverlayFragment.java @@ -673,7 +673,7 @@ private void startFadeTimer() { public void onResume() { super.onResume(); - // Close player when resuming without a valid playback contoller + // Close player when resuming without a valid playback controller if (!playbackControllerContainer.getValue().getPlaybackController().hasFragment()) { if (navigationRepository.getValue().getCanGoBack()) { navigationRepository.getValue().goBack(); @@ -883,8 +883,8 @@ protected Void doInBackground(Integer... params) { // set focus parameters if we are not on first row // this makes focus movements more predictable for the grid view if (prevRow != null) { - TvManager.setFocusParms(row, prevRow, true); - TvManager.setFocusParms(prevRow, row, false); + TvManager.setFocusParams(row, prevRow, true); + TvManager.setFocusParams(prevRow, row, false); } prevRow = row; diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/playback/PlaybackController.java b/app/src/main/java/org/jellyfin/androidtv/ui/playback/PlaybackController.java index 67f7ff05c6..2b7b898910 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/playback/PlaybackController.java +++ b/app/src/main/java/org/jellyfin/androidtv/ui/playback/PlaybackController.java @@ -305,7 +305,7 @@ private Display.Mode findBestDisplayMode(MediaStream videoStream) { if (mode.getPhysicalWidth() < 1280 || mode.getPhysicalHeight() < 720) // Skip non-HD continue; - if (mode.getPhysicalWidth() < videoStream.getWidth() || mode.getPhysicalHeight() < videoStream.getHeight()) // Disallow reso downgrade + if (mode.getPhysicalWidth() < videoStream.getWidth() || mode.getPhysicalHeight() < videoStream.getHeight()) // Disallow resolution downgrade continue; int rate = Math.round(mode.getRefreshRate() * 100); diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/presentation/HorizontalGridPresenter.java b/app/src/main/java/org/jellyfin/androidtv/ui/presentation/HorizontalGridPresenter.java index f4ea6c6ce0..36fb6ca5ac 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/presentation/HorizontalGridPresenter.java +++ b/app/src/main/java/org/jellyfin/androidtv/ui/presentation/HorizontalGridPresenter.java @@ -203,7 +203,7 @@ public void onChildViewHolderSelected(RecyclerView parent, RecyclerView.ViewHold vh.mItemBridgeAdapter.setAdapterListener(new ItemBridgeAdapter.AdapterListener() { @Override public void onBind(final ItemBridgeAdapter.ViewHolder itemViewHolder) { - // Only when having an OnItemClickListner, we attach the OnClickListener. + // Only when having an OnItemClickListener, we attach the OnClickListener. if (getOnItemViewClickedListener() != null) { final View itemView = itemViewHolder.getViewHolder().view; itemView.setOnClickListener(new View.OnClickListener() { diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/presentation/MutableObjectAdapter.kt b/app/src/main/java/org/jellyfin/androidtv/ui/presentation/MutableObjectAdapter.kt index 67b8398538..f88a15984a 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/presentation/MutableObjectAdapter.kt +++ b/app/src/main/java/org/jellyfin/androidtv/ui/presentation/MutableObjectAdapter.kt @@ -8,7 +8,7 @@ import androidx.recyclerview.widget.ListUpdateCallback /** * A leanback ObjectAdapter using a Kotlin list as backend. Implements Iterable to allow collection - * operations. And uses generics for strong typing. Uses a MutableList as internal stucture. + * operations. And uses generics for strong typing. Uses a MutableList as internal structure. */ open class MutableObjectAdapter : ObjectAdapter, Iterable { private val data = mutableListOf() diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/startup/StartupViewModel.kt b/app/src/main/java/org/jellyfin/androidtv/ui/startup/StartupViewModel.kt index 99512278f4..4442c063da 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/startup/StartupViewModel.kt +++ b/app/src/main/java/org/jellyfin/androidtv/ui/startup/StartupViewModel.kt @@ -70,7 +70,7 @@ class StartupViewModel( fun getUserImage(server: Server, user: User): String? = authenticationRepository.getUserImageUrl(server, user) - fun loadDiscoveryservers() { + fun loadDiscoveryServers() { // Only run one discovery process at a time if (discoveryMutex.isLocked) return diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/startup/fragment/SelectServerFragment.kt b/app/src/main/java/org/jellyfin/androidtv/ui/startup/fragment/SelectServerFragment.kt index e69e942dc9..3dca049321 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/startup/fragment/SelectServerFragment.kt +++ b/app/src/main/java/org/jellyfin/androidtv/ui/startup/fragment/SelectServerFragment.kt @@ -214,7 +214,7 @@ class SelectServerFragment : Fragment() { super.onResume() startupViewModel.reloadStoredServers() - startupViewModel.loadDiscoveryservers() + startupViewModel.loadDiscoveryServers() } class ServerAdapter( diff --git a/app/src/main/java/org/jellyfin/androidtv/util/KeyProcessor.java b/app/src/main/java/org/jellyfin/androidtv/util/KeyProcessor.java index 9887e08fe0..981bf28f11 100644 --- a/app/src/main/java/org/jellyfin/androidtv/util/KeyProcessor.java +++ b/app/src/main/java/org/jellyfin/androidtv/util/KeyProcessor.java @@ -306,7 +306,7 @@ public void onError(Exception exception) { }); return true; case MENU_PLAY_FIRST_UNWATCHED: - KeyProcesorHelperKt.playFirstUnwatchedItem(activity, item.getId()); + KeyProcessorHelperKt.playFirstUnwatchedItem(activity, item.getId()); return true; case MENU_MARK_FAVORITE: toggleFavorite(activity, item.getId(), true); diff --git a/app/src/main/java/org/jellyfin/androidtv/util/KeyProcesorHelper.kt b/app/src/main/java/org/jellyfin/androidtv/util/KeyProcessorHelper.kt similarity index 100% rename from app/src/main/java/org/jellyfin/androidtv/util/KeyProcesorHelper.kt rename to app/src/main/java/org/jellyfin/androidtv/util/KeyProcessorHelper.kt diff --git a/app/src/test/kotlin/ui/playback/VideoSpeedControllerTests.kt b/app/src/test/kotlin/ui/playback/VideoSpeedControllerTests.kt index 9d16068268..9e90f46017 100644 --- a/app/src/test/kotlin/ui/playback/VideoSpeedControllerTests.kt +++ b/app/src/test/kotlin/ui/playback/VideoSpeedControllerTests.kt @@ -111,7 +111,7 @@ class VideoSpeedControllerTests : FunSpec({ speedController.currentSpeed shouldBe VideoSpeedController.SpeedSteps.SPEED_1_00 } - test("VideoSpeedController.currentSpeed alwats sets the requested speed when LiveTV is off") { + test("VideoSpeedController.currentSpeed always sets the requested speed when LiveTV is off") { val mockController = mockk(relaxed = true) { every { isLiveTv } returns false } diff --git a/app/src/test/kotlin/util/TimeUtilsTests.kt b/app/src/test/kotlin/util/TimeUtilsTests.kt index f6d5c0d200..3ec0aecc31 100644 --- a/app/src/test/kotlin/util/TimeUtilsTests.kt +++ b/app/src/test/kotlin/util/TimeUtilsTests.kt @@ -4,7 +4,7 @@ import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe class TimeUtilsTests : FunSpec({ - test("TimeUtils.secondstoMillis() works correctly") { + test("TimeUtils.secondsToMillis() works correctly") { TimeUtils.secondsToMillis(0.0) shouldBe 0 TimeUtils.secondsToMillis(1.0) shouldBe 1000 TimeUtils.secondsToMillis(1.25) shouldBe 1250 diff --git a/playback/core/src/main/kotlin/PlayerState.kt b/playback/core/src/main/kotlin/PlayerState.kt index fd4c04bb07..2d2040389f 100644 --- a/playback/core/src/main/kotlin/PlayerState.kt +++ b/playback/core/src/main/kotlin/PlayerState.kt @@ -30,7 +30,7 @@ interface PlayerState { /** * The position information for the currently playing item or [PositionInfo.EMPTY]. This * property is not reactive to avoid performance penalties. Manually read the values every - * second for UI or read when neccesary. + * second for UI or read when necessary. */ val positionInfo: PositionInfo diff --git a/playback/core/src/main/kotlin/PlayerVolumeState.kt b/playback/core/src/main/kotlin/PlayerVolumeState.kt index ee3b9bf86c..fcae836508 100644 --- a/playback/core/src/main/kotlin/PlayerVolumeState.kt +++ b/playback/core/src/main/kotlin/PlayerVolumeState.kt @@ -25,7 +25,7 @@ interface PlayerVolumeState { * Whether the volume and mute state can be changed or not. * Changing the volume/mute state will do nothing when false. */ - val modifyable: Boolean + val modifiable: Boolean /** * Mute the device. @@ -38,12 +38,12 @@ interface PlayerVolumeState { fun unmute() /** - * Increase the device volume by the device prefered amount. + * Increase the device volume by the device preferred amount. */ fun increaseVolume() /** - * Decrease the device volume by the device prefered amount. + * Decrease the device volume by the device preferred amount. */ fun decreaseVolume() @@ -60,7 +60,7 @@ interface PlayerVolumeState { class NoOpPlayerVolumeState : PlayerVolumeState { override val muted = false override val volume = 1f - override val modifyable = false + override val modifiable = false override fun mute() = Unit override fun unmute() = Unit @@ -81,11 +81,11 @@ class AndroidPlayerVolumeState( override val volume: Float get() = audioManager.getStreamVolume(stream).toFloat() / audioManager.getStreamMaxVolume(stream) - override val modifyable: Boolean + override val modifiable: Boolean get() = !audioManager.isVolumeFixed override fun mute() { - if (!modifyable) return + if (!modifiable) return audioManager.adjustStreamVolume( stream, AudioManager.ADJUST_MUTE, @@ -94,7 +94,7 @@ class AndroidPlayerVolumeState( } override fun unmute() { - if (!modifyable) return + if (!modifiable) return audioManager.adjustStreamVolume( stream, AudioManager.ADJUST_UNMUTE, @@ -103,7 +103,7 @@ class AndroidPlayerVolumeState( } override fun increaseVolume() { - if (!modifyable) return + if (!modifiable) return audioManager.adjustStreamVolume( stream, AudioManager.ADJUST_RAISE, @@ -112,7 +112,7 @@ class AndroidPlayerVolumeState( } override fun decreaseVolume() { - if (!modifyable) return + if (!modifiable) return audioManager.adjustStreamVolume( stream, AudioManager.ADJUST_LOWER, @@ -122,7 +122,7 @@ class AndroidPlayerVolumeState( override fun setVolume(@FloatRange(0.0, 1.0) volume: Float) { require(volume in 0f..1f) - if (!modifyable) return + if (!modifiable) return val maxVolume = audioManager.getStreamMaxVolume(stream) val index = (volume * maxVolume).roundToInt() Timber.d("volume=$volume, maxVolume=$maxVolume, index=$index") diff --git a/playback/media3/exoplayer/src/main/kotlin/ExoPlayerAudioPipeline.kt b/playback/media3/exoplayer/src/main/kotlin/ExoPlayerAudioPipeline.kt index adb636a311..2a23843ec8 100644 --- a/playback/media3/exoplayer/src/main/kotlin/ExoPlayerAudioPipeline.kt +++ b/playback/media3/exoplayer/src/main/kotlin/ExoPlayerAudioPipeline.kt @@ -15,7 +15,7 @@ class ExoPlayerAudioPipeline { fun setAudioSessionId(audioSessionId: Int) { Timber.d("Audio session id changed to $audioSessionId") - // Re-creare loudness enhancer for normalization gain + // Re-create loudness enhancer for normalization gain loudnessEnhancer?.release() loudnessEnhancer = runCatching { LoudnessEnhancer(audioSessionId) } .onFailure { Timber.w(it, "Failed to create LoudnessEnhancer") }