From d9c36e236bb1c2b728ca6a2c0ff3599976df1bcd Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Thu, 2 Jan 2014 18:39:59 -0800 Subject: Fix for server defaulting unlimited to 128 kpbs --- src/github/daneren2005/dsub/service/DownloadFile.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') 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() { -- cgit v1.2.3