aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-03-11 19:32:34 -0700
committerScott Jackson <daneren2005@gmail.com>2013-03-11 19:32:34 -0700
commit95011bd13d04caef14e27a0078c1e7e610ecf6f2 (patch)
tree80057fc11fd2f6f6d8f7e123d565b8ef039ed5a4 /subsonic-android/src
parent640fa0455ec3695eb375080232fb8703642f6678 (diff)
downloaddsub-95011bd13d04caef14e27a0078c1e7e610ecf6f2.tar.gz
dsub-95011bd13d04caef14e27a0078c1e7e610ecf6f2.tar.bz2
dsub-95011bd13d04caef14e27a0078c1e7e610ecf6f2.zip
Fix stopped cachedPosition marking
Diffstat (limited to 'subsonic-android/src')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
index 5a097ef7..a0b9c899 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
@@ -777,7 +777,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
return playerState;
}
- public synchronized void setPlayerState(PlayerState playerState) {
+ public synchronized void setPlayerState(final PlayerState playerState) {
Log.i(TAG, this.playerState.name() + " -> " + playerState.name() + " (" + currentPlaying + ")");
if (playerState == PAUSED) {
@@ -811,7 +811,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
Runnable runnable = new Runnable() {
@Override
public void run() {
- if(mediaPlayer != null && getPlayerState() == STARTED) {
+ if(mediaPlayer != null && playerState == STARTED) {
try {
cachedPosition = mediaPlayer.getCurrentPosition();
} catch(Exception e) {
@@ -822,7 +822,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
};
executorService = Executors.newSingleThreadScheduledExecutor();
executorService.scheduleWithFixedDelay(runnable, 200L, 200L, TimeUnit.MILLISECONDS);
- } else {
+ } else if(playerState != STARTED) {
if(executorService != null && !executorService.isShutdown()) {
executorService.shutdownNow();
}