From 5168bdc1bb49ddf53f31a62978d634f1fbf9e89d Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Tue, 4 Feb 2014 14:51:46 -0800 Subject: Possible fix for next song not playing --- src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/github/daneren2005') diff --git a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index cce2796f..79ce52d7 100644 --- a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -770,6 +770,9 @@ public class DownloadServiceImpl extends Service implements DownloadService { // Swap the media players since nextMediaPlayer is ready to play if(start) { nextMediaPlayer.start(); + } else if(!nextMediaPlayer.isPlaying()) { + Log.w(TAG, "nextSetup lied about it's state!"); + nextMediaPlayer.start(); } else { Log.i(TAG, "nextMediaPlayer already playing"); } @@ -854,6 +857,10 @@ public class DownloadServiceImpl extends Service implements DownloadService { } if (index != -1 && nextPlayingIndex < size()) { if(nextPlaying != null && downloadList.get(nextPlayingIndex) == nextPlaying && nextPlayerState == PlayerState.PREPARED && remoteState == RemoteControlState.LOCAL) { + if(mediaPlayer.isPlaying()) { + mediaPlayer.stop(); + } + mediaPlayer.setOnErrorListener(null); mediaPlayer.setOnCompletionListener(null); mediaPlayer.reset(); playNext(true); -- cgit v1.2.3