aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/github/daneren2005/dsub/provider/DLNARouteProvider.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/provider/DLNARouteProvider.java b/src/github/daneren2005/dsub/provider/DLNARouteProvider.java
index 54c9ffb5..73d4b5de 100644
--- a/src/github/daneren2005/dsub/provider/DLNARouteProvider.java
+++ b/src/github/daneren2005/dsub/provider/DLNARouteProvider.java
@@ -165,9 +165,14 @@ public class DLNARouteProvider extends MediaRouteProvider {
for(Map.Entry<String, DLNADevice> deviceEntry: devices.entrySet()) {
DLNADevice device = deviceEntry.getValue();
- int increments = device.volumeMax / 10;
- int volume = controller == null ? device.volume : (int) controller.getVolume();
- volume = volume / increments;
+ int volume;
+ if(device.volumeMax == 0) {
+ volume = 5;
+ } else {
+ int increments = device.volumeMax / 10;
+ volume = controller == null ? device.volume : (int) controller.getVolume();
+ volume = volume / increments;
+ }
MediaRouteDescriptor.Builder routeBuilder = new MediaRouteDescriptor.Builder(device.id, device.name);
routeBuilder.addControlFilter(routeIntentFilter)