diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-09-19 11:47:24 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-09-19 11:47:24 -0700 |
commit | 77c72cc77231723d7ba7ee51d74b9b47e5179464 (patch) | |
tree | 10a041edf3309310cd7631fc020c706567f28539 /src | |
parent | c040b8bdf7bb4df8bbaf5d41887e4f5a98dbbe1c (diff) | |
download | dsub-77c72cc77231723d7ba7ee51d74b9b47e5179464.tar.gz dsub-77c72cc77231723d7ba7ee51d74b9b47e5179464.tar.bz2 dsub-77c72cc77231723d7ba7ee51d74b9b47e5179464.zip |
#404 Fix Tasker calling start() during PREPARE
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/service/DownloadService.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index 33ec85c6..9d454817 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -968,7 +968,13 @@ public class DownloadService extends Service { if (remoteState != RemoteControlState.LOCAL) { remoteController.start(); } else { - mediaPlayer.start(); + // Only start if done preparing + if(playerState != PREPARING) { + mediaPlayer.start(); + } else { + // Otherwise, we need to set it up to start when done preparing + autoPlayStart = true; + } } setPlayerState(STARTED); } catch (Exception x) { @@ -1396,9 +1402,12 @@ public class DownloadService extends Service { } cachedPosition = position; - if (start) { + if (start || autoPlayStart) { mediaPlayer.start(); setPlayerState(STARTED); + + // Disable autoPlayStart after done + autoPlayStart = false; } else { setPlayerState(PAUSED); } |