From 6cab4b4d324dc301a8c29f9963edd47d5f1f2b45 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Sat, 22 Feb 2014 02:00:11 +0100 Subject: [PATCH] Fixed playback stopping after first track of new playlist, fixed notification not showing. --- .../mediarouter/MediaRouterPlayService.java | 3 ++- .../controldlna/upnp/RemotePlayServiceBinder.java | 10 +--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/com/github/nutomic/controldlna/mediarouter/MediaRouterPlayService.java b/src/com/github/nutomic/controldlna/mediarouter/MediaRouterPlayService.java index 81f5704..5377ad6 100644 --- a/src/com/github/nutomic/controldlna/mediarouter/MediaRouterPlayService.java +++ b/src/com/github/nutomic/controldlna/mediarouter/MediaRouterPlayService.java @@ -394,7 +394,8 @@ public class MediaRouterPlayService extends Service { status.getPlaybackState() != MediaItemStatus.PLAYBACK_STATE_PLAYING) stopForeground(true); - if (status.getPlaybackState() == MediaItemStatus.PLAYBACK_STATE_FINISHED) + if (status.getPlaybackState() == MediaItemStatus.PLAYBACK_STATE_FINISHED || + status.getPlaybackState() == MediaItemStatus.PLAYBACK_STATE_CANCELED) playNext(); } }); diff --git a/src/com/github/nutomic/controldlna/upnp/RemotePlayServiceBinder.java b/src/com/github/nutomic/controldlna/upnp/RemotePlayServiceBinder.java index b060787..5a67ee8 100644 --- a/src/com/github/nutomic/controldlna/upnp/RemotePlayServiceBinder.java +++ b/src/com/github/nutomic/controldlna/upnp/RemotePlayServiceBinder.java @@ -73,8 +73,6 @@ public class RemotePlayServiceBinder extends IRemotePlayService.Stub { private int mPlaybackState; - private boolean mManuallyStopped; - SubscriptionCallback mSubscriptionCallback; private RemotePlayService mRps; @@ -134,12 +132,7 @@ public class RemotePlayServiceBinder extends IRemotePlayService.Stub { mPlaybackState = MediaItemStatus.PLAYBACK_STATE_PAUSED; break; case STOPPED: - if (mManuallyStopped) { - mManuallyStopped = false; - mPlaybackState = MediaItemStatus.PLAYBACK_STATE_CANCELED; - } - else - mPlaybackState = MediaItemStatus.PLAYBACK_STATE_FINISHED; + mPlaybackState = MediaItemStatus.PLAYBACK_STATE_FINISHED; break; case TRANSITIONING: mPlaybackState = MediaItemStatus.PLAYBACK_STATE_PENDING; @@ -291,7 +284,6 @@ public class RemotePlayServiceBinder extends IRemotePlayService.Stub { */ @Override public void stop(String sessionId) throws RemoteException { - mManuallyStopped = true; mRps.mUpnpService.getControlPoint().execute( new Stop(mRps.getService(mRps.mDevices.get(sessionId), "AVTransport")) {