diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-01-25 11:37:39 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-01-25 11:37:39 -0800 |
commit | 45772477899c9d3ef7d119376f0e39d18ebf6456 (patch) | |
tree | a2bbb916ca5e926d26b90ea90cd6142d72748e31 /src/github/daneren2005 | |
parent | a63ee28e6d59efbf4e1ba7f824f508e54fef523c (diff) | |
download | dsub-45772477899c9d3ef7d119376f0e39d18ebf6456.tar.gz dsub-45772477899c9d3ef7d119376f0e39d18ebf6456.tar.bz2 dsub-45772477899c9d3ef7d119376f0e39d18ebf6456.zip |
Call Stop before starting the next song (some DLNA devices such as Samsung TV throw error otherwise)
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/service/DLNAController.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/service/DLNAController.java b/src/github/daneren2005/dsub/service/DLNAController.java index 5d87e478..219038ad 100644 --- a/src/github/daneren2005/dsub/service/DLNAController.java +++ b/src/github/daneren2005/dsub/service/DLNAController.java @@ -318,6 +318,20 @@ public class DLNAController extends RemoteController { }
private void startSong(final DownloadFile currentPlaying, final boolean autoStart, final int position) {
+ controlPoint.execute(new Stop(getTransportService()) {
+ @Override
+ public void success(ActionInvocation invocation) {
+ startSongRemote(currentPlaying, autoStart, position);
+ }
+
+ @Override
+ public void failure(ActionInvocation invocation, org.fourthline.cling.model.message.UpnpResponse operation, String defaultMessage) {
+ Log.w(TAG, "Stop failed before startSong: " + defaultMessage);
+ startSongRemote(currentPlaying, autoStart, position);
+ }
+ });
+ }
+ private void startSongRemote(final DownloadFile currentPlaying, final boolean autoStart, final int position) {
if(currentPlaying == null) {
downloadService.setPlayerState(PlayerState.IDLE);
return;
|