diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-12-02 21:54:39 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-12-02 21:54:39 -0800 |
commit | ee03f7b71334f10f960d775d0468622490c08504 (patch) | |
tree | cbe7d0a63b3ad008f41596f326b9efaa2902b0c8 /src/github | |
parent | 685a971c264e4dad14d8053d8bf2b9021ba0b84f (diff) | |
download | dsub-ee03f7b71334f10f960d775d0468622490c08504.tar.gz dsub-ee03f7b71334f10f960d775d0468622490c08504.tar.bz2 dsub-ee03f7b71334f10f960d775d0468622490c08504.zip |
#201 Fix other places that get wrong bitrate
Diffstat (limited to 'src/github')
-rw-r--r-- | src/github/daneren2005/dsub/service/DownloadFile.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadFile.java b/src/github/daneren2005/dsub/service/DownloadFile.java index 41c5b969..434773c3 100644 --- a/src/github/daneren2005/dsub/service/DownloadFile.java +++ b/src/github/daneren2005/dsub/service/DownloadFile.java @@ -86,13 +86,16 @@ public class DownloadFile { */ public int getBitRate() { if(!partialFile.exists()) { - bitRate = song.isVideo() ? Util.getMaxVideoBitrate(context) : Util.getMaxBitrate(context); + bitRate = getActualBitrate(); } if (bitRate > 0) { return bitRate; } return song.getBitRate() == null ? 160 : song.getBitRate(); } + private int getActualBitrate() { + return song.isVideo() ? Util.getMaxVideoBitrate(context) : Util.getMaxBitrate(context); + } public Integer getContentLength() { return contentLength; @@ -111,7 +114,7 @@ public class DownloadFile { FileUtil.createDirectoryForParent(saveFile); failedDownload = false; if(!partialFile.exists()) { - bitRate = Util.getMaxBitrate(context); + bitRate = getActualBitrate(); } downloadTask = new DownloadTask(); } |