diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-03-23 18:32:50 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-03-23 18:32:50 -0700 |
commit | 5063a7f315ae18b669e35a505b88055fe2fba2e9 (patch) | |
tree | 6b4056a4292e4a80473cd91302220d05b526105f /subsonic-android/src | |
parent | 0953126a63feb8a3946bcb436a6bd17eeddb0cfa (diff) | |
parent | 6014834db00a816f663fc88e8ce75c7fd984152d (diff) | |
download | dsub-5063a7f315ae18b669e35a505b88055fe2fba2e9.tar.gz dsub-5063a7f315ae18b669e35a505b88055fe2fba2e9.tar.bz2 dsub-5063a7f315ae18b669e35a505b88055fe2fba2e9.zip |
Merge branch 'master' of https://github.com/daneren2005/Subsonic.git
Diffstat (limited to 'subsonic-android/src')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/StreamProxy.java | 4 | ||||
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/util/ModalBackgroundTask.java | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/StreamProxy.java b/subsonic-android/src/github/daneren2005/dsub/service/StreamProxy.java index 1b422d5a..8407fa12 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/StreamProxy.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/StreamProxy.java @@ -161,7 +161,7 @@ public class StreamProxy implements Runnable { protected Integer doInBackground(String... params) {
DownloadFile downloadFile = downloadService.getCurrentPlaying();
MusicDirectory.Entry song = downloadFile.getSong();
- long fileSize = downloadFile.getBitRate() * song.getDuration() * 1000 / 8;
+ long fileSize = downloadFile.getBitRate() * ((song.getDuration() != null) ? song.getDuration() : 0) * 1000 / 8;
Log.i(TAG, "Streaming fileSize: " + fileSize);
// Create HTTP header
@@ -243,4 +243,4 @@ public class StreamProxy implements Runnable { return 1;
}
}
-}
\ No newline at end of file +} diff --git a/subsonic-android/src/github/daneren2005/dsub/util/ModalBackgroundTask.java b/subsonic-android/src/github/daneren2005/dsub/util/ModalBackgroundTask.java index 8873b62c..a81b9246 100644 --- a/subsonic-android/src/github/daneren2005/dsub/util/ModalBackgroundTask.java +++ b/subsonic-android/src/github/daneren2005/dsub/util/ModalBackgroundTask.java @@ -101,7 +101,11 @@ public abstract class ModalBackgroundTask<T> extends BackgroundTask<T> { getHandler().post(new Runnable() { @Override public void run() { - progressDialog.dismiss(); + try { + progressDialog.dismiss(); + } catch(Exception e) { + Log.w(TAG, "Failed to dismiss dialog"); + } error(t); } }); |