aboutsummaryrefslogtreecommitdiff
path: root/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-01-02 18:39:59 -0800
committerScott Jackson <daneren2005@gmail.com>2014-01-02 18:39:59 -0800
commitd9c36e236bb1c2b728ca6a2c0ff3599976df1bcd (patch)
treeae0c13271b5d51d39b7fc8fda198b0a9add40472 /src/github
parent18f827cf970124059044d5c1c8c4fa50893d6778 (diff)
downloaddsub-d9c36e236bb1c2b728ca6a2c0ff3599976df1bcd.tar.gz
dsub-d9c36e236bb1c2b728ca6a2c0ff3599976df1bcd.tar.bz2
dsub-d9c36e236bb1c2b728ca6a2c0ff3599976df1bcd.zip
Fix for server defaulting unlimited to 128 kpbs
Diffstat (limited to 'src/github')
-rw-r--r--src/github/daneren2005/dsub/service/DownloadFile.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadFile.java b/src/github/daneren2005/dsub/service/DownloadFile.java
index 3c896693..c3758b01 100644
--- a/src/github/daneren2005/dsub/service/DownloadFile.java
+++ b/src/github/daneren2005/dsub/service/DownloadFile.java
@@ -94,7 +94,15 @@ public class DownloadFile {
return song.getBitRate() == null ? 160 : song.getBitRate();
}
private int getActualBitrate() {
- return song.isVideo() ? Util.getMaxVideoBitrate(context) : Util.getMaxBitrate(context);
+ int br = song.isVideo() ? Util.getMaxVideoBitrate(context) : Util.getMaxBitrate(context);
+ if(br == 0 && "mp3".equals(song.getTranscodedSuffix().toLowerCase())) {
+ if(song.getBitRate() != null) {
+ br = Math.min(320, song.getBitRate());
+ } else {
+ br = 320;
+ }
+ }
+ return br;
}
public Integer getContentLength() {