aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src
diff options
context:
space:
mode:
Diffstat (limited to 'subsonic-android/src')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/StreamProxy.java4
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/util/ModalBackgroundTask.java6
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);
}
});