From 45772477899c9d3ef7d119376f0e39d18ebf6456 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sun, 25 Jan 2015 11:37:39 -0800 Subject: Call Stop before starting the next song (some DLNA devices such as Samsung TV throw error otherwise) --- src/github/daneren2005/dsub/service/DLNAController.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/github') 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; -- cgit v1.2.3