aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-08-11 09:28:29 -0700
committerScott Jackson <daneren2005@gmail.com>2013-08-11 09:28:29 -0700
commit78b5087916b6a0c19efaac07f2061748b9e2724c (patch)
treeacb266756b42feb9e294c9b2bdfb0aaf8912a0ff
parent21ca9cbf358e8d8c7dcf98780aa31167159e66be (diff)
downloaddsub-78b5087916b6a0c19efaac07f2061748b9e2724c.tar.gz
dsub-78b5087916b6a0c19efaac07f2061748b9e2724c.tar.bz2
dsub-78b5087916b6a0c19efaac07f2061748b9e2724c.zip
Stop media player setup concurrent with RemoteControl on
-rw-r--r--src/github/daneren2005/dsub/service/DownloadServiceImpl.java12
-rw-r--r--src/github/daneren2005/dsub/service/JukeboxController.java2
2 files changed, 10 insertions, 4 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
index 06c7495d..88898887 100644
--- a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
+++ b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
@@ -252,6 +252,10 @@ public class DownloadServiceImpl extends Service implements DownloadService {
if(nextPlayingTask != null) {
nextPlayingTask.cancel();
}
+ if(remoteController != null) {
+ remoteController.stop();
+ remoteController.shutdown();
+ }
Util.hidePlayingNotification(this, this, handler);
}
@@ -348,7 +352,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
}
play(currentPlayingIndex, false);
- if (currentPlaying != null && currentPlaying.isCompleteFileAvailable()) {
+ if (currentPlaying != null && currentPlaying.isCompleteFileAvailable() && remoteState == RemoteControlState.LOCAL) {
doPlay(currentPlaying, currentPlayingPosition, autoPlayStart);
}
autoPlayStart = false;
@@ -673,8 +677,10 @@ public class DownloadServiceImpl extends Service implements DownloadService {
bufferAndPlay();
}
}
- checkDownloads();
- setNextPlaying();
+ if (remoteState == RemoteControlState.LOCAL) {
+ checkDownloads();
+ setNextPlaying();
+ }
}
}
private synchronized void playNext() {
diff --git a/src/github/daneren2005/dsub/service/JukeboxController.java b/src/github/daneren2005/dsub/service/JukeboxController.java
index 30160c1c..3904066d 100644
--- a/src/github/daneren2005/dsub/service/JukeboxController.java
+++ b/src/github/daneren2005/dsub/service/JukeboxController.java
@@ -149,7 +149,7 @@ public class JukeboxController extends RemoteController {
try {
task = tasks.take();
RemoteStatus status = task.execute();
- if(status != null) {
+ if(status != null && running) {
onStatusUpdate(status);
}
} catch (Throwable x) {