aboutsummaryrefslogtreecommitdiff
path: root/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-10-19 19:33:53 -0700
committerScott Jackson <daneren2005@gmail.com>2014-10-19 19:33:53 -0700
commit6db94adbf87e92474996a5bc69364762898014c6 (patch)
tree5ca3e5601432d4a6439d11bad56596fdbd5db6c4 /src/github
parentb0060e1f648516b3f7c0a2656acd2ae99c4af3ed (diff)
downloaddsub-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.java1
-rw-r--r--src/github/daneren2005/dsub/service/DownloadService.java4
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