aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/DLNAController.java2
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/DownloadService.java11
2 files changed, 9 insertions, 4 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/service/DLNAController.java b/app/src/main/java/github/daneren2005/dsub/service/DLNAController.java
index a0dc16c1..94bf7231 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/DLNAController.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/DLNAController.java
@@ -633,7 +633,7 @@ public class DLNAController extends RemoteController {
if(positionInfo.getTrackURI() != null && positionInfo.getTrackURI().equals(nextPlayingURI) && downloadService.getNextPlayerState() == PlayerState.PREPARED) {
downloadService.setCurrentPlaying(nextPlaying, true);
downloadService.setPlayerState(PlayerState.STARTED);
- downloadService.setNextPlaying();
+ downloadService.setNextPlayerState(PlayerState.IDLE);
}
downloadService.postDelayed(new Runnable() {
diff --git a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java
index 37070903..ae619802 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java
@@ -1416,9 +1416,7 @@ public class DownloadService extends Service {
}
if(remoteController != null && remoteController.isNextSupported()) {
- if(playerState == STARTED && nextPlayerState == IDLE) {
- setNextPlaying();
- } else if(playerState == PREPARING || playerState == IDLE) {
+ if(playerState == PREPARING || playerState == IDLE) {
nextPlayerState = IDLE;
}
}
@@ -2679,6 +2677,13 @@ public class DownloadService extends Service {
}
});
}
+
+ // Setup next playing at least a couple of seconds into the song since both Chromecast and some DLNA clients report PLAYING when still PREPARING
+ if(position > 2000 && remoteController != null && remoteController.isNextSupported()) {
+ if(playerState == STARTED && nextPlayerState == IDLE) {
+ setNextPlaying();
+ }
+ }
}
private void onStateUpdate() {
final long atRevision = revision;