aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2012-12-28 20:18:15 -0800
committerScott Jackson <daneren2005@gmail.com>2012-12-28 20:18:15 -0800
commit2ad41824e560c596aa7dcf6df556230ed0d12e0d (patch)
tree87abd5affd9fc7f7bbe5c6af07bd0617d180445a /subsonic-android/src
parenta9c7bbb3b803ceab21afe5d3cdb4166f40cfc37a (diff)
downloaddsub-2ad41824e560c596aa7dcf6df556230ed0d12e0d.tar.gz
dsub-2ad41824e560c596aa7dcf6df556230ed0d12e0d.tar.bz2
dsub-2ad41824e560c596aa7dcf6df556230ed0d12e0d.zip
Fixed playing currently streaming files
Diffstat (limited to 'subsonic-android/src')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
index 66f8a79f..0fd2f9ac 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
@@ -672,6 +672,8 @@ public class DownloadServiceImpl extends Service implements DownloadService {
bufferTask.cancel();
}
try {
+ mediaPlayer.setOnErrorListener(null);
+ mediaPlayer.setOnCompletionListener(null);
mediaPlayer.reset();
setPlayerState(IDLE);
} catch (Exception x) {
@@ -824,7 +826,6 @@ public class DownloadServiceImpl extends Service implements DownloadService {
}
private synchronized void doPlay(final DownloadFile downloadFile, final int position, final boolean start) {
- // TODO: Start play at curr pos on rebuffer instead of restart
try {
final File file = downloadFile.isCompleteFileAvailable() ? downloadFile.getCompleteFile() : downloadFile.getPartialFile();
downloadFile.updateModificationDate();
@@ -906,7 +907,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
mediaPlayer.setOnErrorListener(new MediaPlayer.OnErrorListener() {
public boolean onError(MediaPlayer mediaPlayer, int what, int extra) {
- Log.w(TAG, "Error on playing file " + "(" + what + ", " + extra + "): " + file.getPath());
+ Log.w(TAG, "Error on playing file " + "(" + what + ", " + extra + "): " + downloadFile);
reset();
downloadFile.setPlaying(false);
doPlay(downloadFile, 0, true);