aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/github/daneren2005/dsub/service/RESTMusicService.java9
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));