From 2eff8611ac2acfe13eb46d9757d169e1203dcfe8 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 27 Nov 2015 15:10:43 -0800 Subject: Fix error if volumeMax is < 10 and increments gets rounded to 0 --- .../main/java/github/daneren2005/dsub/provider/DLNARouteProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/src/main/java/github/daneren2005/dsub/provider/DLNARouteProvider.java b/app/src/main/java/github/daneren2005/dsub/provider/DLNARouteProvider.java index 73d4b5de..c5632362 100644 --- a/app/src/main/java/github/daneren2005/dsub/provider/DLNARouteProvider.java +++ b/app/src/main/java/github/daneren2005/dsub/provider/DLNARouteProvider.java @@ -169,7 +169,7 @@ public class DLNARouteProvider extends MediaRouteProvider { if(device.volumeMax == 0) { volume = 5; } else { - int increments = device.volumeMax / 10; + int increments = (int) Math.ceil(device.volumeMax / 10.0); volume = controller == null ? device.volume : (int) controller.getVolume(); volume = volume / increments; } -- cgit v1.2.3