diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-01-25 09:21:21 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-01-25 09:21:21 -0800 |
commit | 71e410832a1386c30e294a2db23db15ba78f3558 (patch) | |
tree | 14de03cd93ac877ad96d534ec947e8b28e861ec8 /src/github/daneren2005 | |
parent | 58397bb63be97ca57e33594d73a5a729a4ba8754 (diff) | |
download | dsub-71e410832a1386c30e294a2db23db15ba78f3558.tar.gz dsub-71e410832a1386c30e294a2db23db15ba78f3558.tar.bz2 dsub-71e410832a1386c30e294a2db23db15ba78f3558.zip |
Everything support mp3, so when mp3 -> mp3 just specify raw so content length is correct
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/service/RESTMusicService.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/service/RESTMusicService.java b/src/github/daneren2005/dsub/service/RESTMusicService.java index f0144ee4..cc9362fd 100644 --- a/src/github/daneren2005/dsub/service/RESTMusicService.java +++ b/src/github/daneren2005/dsub/service/RESTMusicService.java @@ -730,7 +730,14 @@ public class RESTMusicService implements MusicService { public String getMusicUrl(Context context, MusicDirectory.Entry song, int maxBitrate) throws Exception { StringBuilder builder = new StringBuilder(getRestUrl(context, "stream")); builder.append("&id=").append(song.getId()); - builder.append("&maxBitRate=").append(maxBitrate); + + // If we are doing mp3 to mp3, just specify raw so that stuff works better + if("mp3".equals(song.getSuffix()) && (song.getTranscodedSuffix() == null || "mp3".equals(song.getTranscodedSuffix())) && ServerInfo.checkServerVersion(context, "1.9", getInstance(context))) { + builder.append("&format=raw"); + builder.append("&estimateContentLength=true"); + } else { + builder.append("&maxBitRate=").append(maxBitrate); + } String url = builder.toString(); Log.i(TAG, "Using music URL: " + stripUrlInfo(url)); |