forked from j62/ctbrec
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.
This commit is contained in:
parent
6ee39cb6f4
commit
91ea7d65a3
|
@ -54,7 +54,7 @@ public class StreamSource implements Comparable<StreamSource> {
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(StreamSource o) {
|
public int compareTo(StreamSource o) {
|
||||||
int heightDiff = height - o.height;
|
int heightDiff = height - o.height;
|
||||||
if(heightDiff != 0) {
|
if(heightDiff != 0 && height != Integer.MAX_VALUE && o.height != Integer.MAX_VALUE) {
|
||||||
return heightDiff;
|
return heightDiff;
|
||||||
} else {
|
} else {
|
||||||
return bandwidth - o.bandwidth;
|
return bandwidth - o.bandwidth;
|
||||||
|
|
Loading…
Reference in New Issue