aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-02-28 09:26:34 -0800
committerScott Jackson <daneren2005@gmail.com>2014-02-28 09:26:34 -0800
commitd02746217a47174b98b3d4f83c1b7ee1faeddea6 (patch)
tree430a36688d3eb982f99e902eb9a610a7c92a98a5
parent31c86419eb844e79c4021a114fcf37bf4fa023c0 (diff)
downloaddsub-d02746217a47174b98b3d4f83c1b7ee1faeddea6.tar.gz
dsub-d02746217a47174b98b3d4f83c1b7ee1faeddea6.tar.bz2
dsub-d02746217a47174b98b3d4f83c1b7ee1faeddea6.zip
Fix crash on audio focus change before initialized
-rw-r--r--src/github/daneren2005/dsub/service/DownloadService.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java
index faa88948..ce3c3799 100644
--- a/src/github/daneren2005/dsub/service/DownloadService.java
+++ b/src/github/daneren2005/dsub/service/DownloadService.java
@@ -1465,7 +1465,7 @@ public class DownloadService extends Service {
}
public void setVolume(float volume) {
- if(mediaPlayer != null) {
+ if(mediaPlayer != null && (playerState == STARTED || playerState == PAUSED || playerState == STOPPED)) {
mediaPlayer.setVolume(volume, volume);
}
}