From a74776777857fd47ba2ea828f9e93a860c379393 Mon Sep 17 00:00:00 2001 From: daneren2005 Date: Mon, 8 Jul 2013 13:08:55 -0700 Subject: Don't chain media players at all when gapless playback is set to off --- .../github/daneren2005/dsub/service/DownloadServiceImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'subsonic-android/src/github') diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index eaac051e..ea9233f2 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -552,6 +552,12 @@ public class DownloadServiceImpl extends Service implements DownloadService { } synchronized void setNextPlaying() { + SharedPreferences prefs = Util.getPreferences(DownloadServiceImpl.this); + boolean gaplessPlayback = prefs.getBoolean(Constants.PREFERENCES_KEY_GAPLESS_PLAYBACK, true); + if(!gaplessPlayback) { + return; + } + int index = getCurrentPlayingIndex(); if (index != -1) { switch (getRepeatMode()) { @@ -1127,9 +1133,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { try { setNextPlayerState(PREPARED); - SharedPreferences prefs = Util.getPreferences(DownloadServiceImpl.this); - boolean gaplessPlayback = prefs.getBoolean(Constants.PREFERENCES_KEY_GAPLESS_PLAYBACK, true); - if(gaplessPlayback && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN && (playerState == PlayerState.STARTED || playerState == PlayerState.PAUSED)) { + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN && (playerState == PlayerState.STARTED || playerState == PlayerState.PAUSED)) { mediaPlayer.setNextMediaPlayer(nextMediaPlayer); nextSetup = true; } -- cgit v1.2.3