From 91ea7d65a33e63e8766ccad11993b80ac27f58e5 Mon Sep 17 00:00:00 2001 From: 0xboobface <0xboobface@gmail.com> Date: Mon, 26 Nov 2018 00:13:53 +0100 Subject: [PATCH] Sort by height only if the height is set If the height is not available, it is set to Integer.MAX_VALUE. IT makes not sense to compare by that value. Instead compare the bitrates. --- common/src/main/java/ctbrec/recorder/download/StreamSource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/ctbrec/recorder/download/StreamSource.java b/common/src/main/java/ctbrec/recorder/download/StreamSource.java index 1968df81..dbb86f03 100644 --- a/common/src/main/java/ctbrec/recorder/download/StreamSource.java +++ b/common/src/main/java/ctbrec/recorder/download/StreamSource.java @@ -54,7 +54,7 @@ public class StreamSource implements Comparable { @Override public int compareTo(StreamSource o) { int heightDiff = height - o.height; - if(heightDiff != 0) { + if(heightDiff != 0 && height != Integer.MAX_VALUE && o.height != Integer.MAX_VALUE) { return heightDiff; } else { return bandwidth - o.bandwidth;