aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-03-27 21:46:33 -0700
committerScott Jackson <daneren2005@gmail.com>2014-03-27 21:46:33 -0700
commitb74cf937a261d4952787e4534a8c7e49f8804663 (patch)
tree2bd89623e6605d095d95a855279923d4f492c34d
parent7abd385c63a28111d08294dd6536eec5ebacca4f (diff)
downloaddsub-b74cf937a261d4952787e4534a8c7e49f8804663.tar.gz
dsub-b74cf937a261d4952787e4534a8c7e49f8804663.tar.bz2
dsub-b74cf937a261d4952787e4534a8c7e49f8804663.zip
#287 Work around for getPosition returning duration of previous songs
-rw-r--r--src/github/daneren2005/dsub/service/DownloadService.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java
index 335e7812..93b9ef66 100644
--- a/src/github/daneren2005/dsub/service/DownloadService.java
+++ b/src/github/daneren2005/dsub/service/DownloadService.java
@@ -1338,6 +1338,11 @@ public class DownloadService extends Service {
if(nextMediaPlayer != null) {
nextMediaPlayer.setOnCompletionListener(null);
nextMediaPlayer.setOnErrorListener(null);
+ try {
+ nextMediaPlayer.setNextMediaPlayer(null);
+ } catch(Exception e) {
+ // Don't care
+ }
nextMediaPlayer.reset();
nextMediaPlayer.release();
nextMediaPlayer = null;
@@ -1355,6 +1360,11 @@ public class DownloadService extends Service {
} catch(Throwable e) {
nextMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
}
+ try {
+ nextMediaPlayer.setNextMediaPlayer(null);
+ } catch(Exception e) {
+ // Don't care
+ }
nextMediaPlayer.setDataSource(file.getPath());
setNextPlayerState(PREPARING);