[Android] Equalizer: Fix IllegalArgumentException

Geoffrey Métais git at videolan.org
Thu Jun 7 17:37:42 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jun  7 17:37:26 2018 +0200| [7e36b0ac85568645c0d734c652bdd927367aba32] | committer: Geoffrey Métais

Equalizer: Fix IllegalArgumentException

> https://code.videolan.org/videolan/vlc-android/commit/7e36b0ac85568645c0d734c652bdd927367aba32
---

 vlc-android/src/org/videolan/vlc/PlaybackService.kt               | 2 +-
 vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.java | 6 +-----
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.kt b/vlc-android/src/org/videolan/vlc/PlaybackService.kt
index 309467456..27f425388 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.kt
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.kt
@@ -1189,7 +1189,7 @@ class PlaybackService : MediaBrowserServiceCompat() {
     }
 
     @MainThread
-    fun setEqualizer(equalizer: MediaPlayer.Equalizer) = playlistManager.player.setEqualizer(equalizer)
+    fun setEqualizer(equalizer: MediaPlayer.Equalizer?) = playlistManager.player.setEqualizer(equalizer)
 
     @MainThread
     fun setVideoScale(scale: Float) = playlistManager.player.setVideoScale(scale)
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.java
index 3af2e7906..961c416a7 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.java
@@ -147,11 +147,7 @@ public class EqualizerFragment extends AppCompatDialogFragment implements Playba
         binding.equalizerButton.setOnCheckedChangeListener(new OnCheckedChangeListener() {
             @Override
             public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-                if (mService != null)
-                    if (isChecked)
-                        mService.setEqualizer(mEqualizer);
-                    else
-                        mService.setEqualizer(null);
+                if (mService != null)  mService.setEqualizer(isChecked ? mEqualizer : null);
             }
         });
         binding.equalizerSave.setOnClickListener(new View.OnClickListener() {



More information about the Android mailing list