aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-01-12 20:12:00 -0800
committerScott Jackson <daneren2005@gmail.com>2014-01-12 20:12:00 -0800
commitd0936909afd512c5c4ef1fe07ddc331ac161aec0 (patch)
tree8f46cb4ee3fb232c5fe9b1f124edb379b46c3954 /src
parent5a3424ca5e919f1f0f10435c8a3caff0113d6f01 (diff)
parent1dfa550dcc28662232cb6a68f154f2a66ff19740 (diff)
downloaddsub-d0936909afd512c5c4ef1fe07ddc331ac161aec0.tar.gz
dsub-d0936909afd512c5c4ef1fe07ddc331ac161aec0.tar.bz2
dsub-d0936909afd512c5c4ef1fe07ddc331ac161aec0.zip
Merge branch 'master' of https://github.com/daneren2005/Subsonic into Tags
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/fragments/DownloadFragment.java6
-rw-r--r--src/github/daneren2005/dsub/service/DownloadFile.java14
2 files changed, 11 insertions, 9 deletions
diff --git a/src/github/daneren2005/dsub/fragments/DownloadFragment.java b/src/github/daneren2005/dsub/fragments/DownloadFragment.java
index 9b634aac..de721f7d 100644
--- a/src/github/daneren2005/dsub/fragments/DownloadFragment.java
+++ b/src/github/daneren2005/dsub/fragments/DownloadFragment.java
@@ -1110,8 +1110,10 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
switch (playerState) {
case DOWNLOADING:
- long bytes = currentPlaying.getPartialFile().length();
- statusTextView.setText(context.getResources().getString(R.string.download_playerstate_downloading, Util.formatLocalizedBytes(bytes, context)));
+ if(currentPlaying != null) {
+ long bytes = currentPlaying.getPartialFile().length();
+ statusTextView.setText(context.getResources().getString(R.string.download_playerstate_downloading, Util.formatLocalizedBytes(bytes, context)));
+ }
break;
case PREPARING:
statusTextView.setText(R.string.download_playerstate_buffering);
diff --git a/src/github/daneren2005/dsub/service/DownloadFile.java b/src/github/daneren2005/dsub/service/DownloadFile.java
index 27fc0708..d7a05da7 100644
--- a/src/github/daneren2005/dsub/service/DownloadFile.java
+++ b/src/github/daneren2005/dsub/service/DownloadFile.java
@@ -95,13 +95,13 @@ public class DownloadFile {
}
private int getActualBitrate() {
int br = song.isVideo() ? Util.getMaxVideoBitrate(context) : Util.getMaxBitrate(context);
- if (br == 0 && song.getTranscodedSuffix() != null &&
- "mp3".equals(song.getTranscodedSuffix().toLowerCase()) &&
- song.getBitRate() != null) {
- br = Math.min(320, song.getBitRate());
- } else {
- br = 320;
- }
+ if(br == 0 && song.getTranscodedSuffix() != null && "mp3".equals(song.getTranscodedSuffix().toLowerCase())) {
+ if(song.getBitRate() != null) {
+ br = Math.min(320, song.getBitRate());
+ } else {
+ br = 320;
+ }
+ }
return br;
}