diff options
-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 |