diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-10-19 19:33:53 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-10-19 19:33:53 -0700 |
commit | 6db94adbf87e92474996a5bc69364762898014c6 (patch) | |
tree | 5ca3e5601432d4a6439d11bad56596fdbd5db6c4 /src/github | |
parent | b0060e1f648516b3f7c0a2656acd2ae99c4af3ed (diff) | |
download | dsub-6db94adbf87e92474996a5bc69364762898014c6.tar.gz dsub-6db94adbf87e92474996a5bc69364762898014c6.tar.bz2 dsub-6db94adbf87e92474996a5bc69364762898014c6.zip |
Fix more cases where the EQ fails
Diffstat (limited to 'src/github')
-rw-r--r-- | src/github/daneren2005/dsub/audiofx/EqualizerController.java | 1 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/service/DownloadService.java | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/audiofx/EqualizerController.java b/src/github/daneren2005/dsub/audiofx/EqualizerController.java index 18a4e3e4..f170af0b 100644 --- a/src/github/daneren2005/dsub/audiofx/EqualizerController.java +++ b/src/github/daneren2005/dsub/audiofx/EqualizerController.java @@ -113,6 +113,7 @@ public class EqualizerController { init(); } catch (Throwable x) { equalizer = null; + released = true; Log.w(TAG, "Failed to create equalizer.", x); } } diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index e6ffbd32..d4344e5b 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -70,6 +70,7 @@ import android.content.SharedPreferences; import android.media.AudioManager; import android.media.MediaPlayer; import android.media.audiofx.AudioEffect; +import android.media.audiofx.Equalizer; import android.os.Build; import android.os.Handler; import android.os.IBinder; @@ -1235,6 +1236,9 @@ public class DownloadService extends Service { mediaPlayer.setDataSource(currentPlaying.getFile().getCanonicalPath()); controller = effectsController.getEqualizerController(); + if(controller.getEqualizer() == null) { + throw new Exception("Failed to get EQ"); + } } catch(Exception e2) { Log.w(TAG, "Failed to setup EQ even after reinitialization"); // Don't try again, just resetup media player and continue on |