diff options
author | Scott Jackson <daneren2005@gmail.com> | 2012-12-12 22:27:52 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2012-12-12 22:27:52 -0800 |
commit | f6bc677b0c186b6807684c57d581146e2dcad9b2 (patch) | |
tree | 3d28ed0c39684fc96e390a93aacf158cfe9d7faf | |
parent | eb4c35b5c23e87fe79f98d8bdca364a86c456436 (diff) | |
download | dsub-f6bc677b0c186b6807684c57d581146e2dcad9b2.tar.gz dsub-f6bc677b0c186b6807684c57d581146e2dcad9b2.tar.bz2 dsub-f6bc677b0c186b6807684c57d581146e2dcad9b2.zip |
Just always use cached position, some devices return extremely large numbers instead of 0
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index d4cf4eb9..11e81ec5 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -850,13 +850,10 @@ public class DownloadServiceImpl extends Service implements DownloadService { } // If file is not completely downloaded, restart the playback from the current position. - int pos = mediaPlayer.getCurrentPosition(); - if(pos == 0) { - Log.w(TAG, "Using cached current position"); - pos = cachedPosition; - } + int pos = cachedPosition; synchronized (DownloadServiceImpl.this) { int duration = downloadFile.getSong().getDuration() == null ? 0 : downloadFile.getSong().getDuration() * 1000; + Log.i(TAG, "Ending position " + pos + " of " + duration); if(downloadFile.isWorkDone()) { // Reached the end of the song if(Math.abs(duration - pos) < 10000) { |