Don't fetch stream resolution if model is offline
This commit is contained in:
parent
8ee3d8b588
commit
b447c76dac
|
@ -171,12 +171,15 @@ public class BongaCamsModel extends AbstractModel {
|
||||||
return new int[2];
|
return new int[2];
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
if(!isOnline()) {
|
||||||
|
return new int[2];
|
||||||
|
}
|
||||||
List<StreamSource> streamSources = getStreamSources();
|
List<StreamSource> streamSources = getStreamSources();
|
||||||
Collections.sort(streamSources);
|
Collections.sort(streamSources);
|
||||||
StreamSource best = streamSources.get(streamSources.size()-1);
|
StreamSource best = streamSources.get(streamSources.size()-1);
|
||||||
resolution = new int[] {best.width, best.height};
|
resolution = new int[] {best.width, best.height};
|
||||||
} catch (ExecutionException | IOException | ParseException | PlaylistException e) {
|
} catch (ExecutionException | IOException | ParseException | PlaylistException | InterruptedException e) {
|
||||||
LOG.error("Couldn't determine stream resolution for {}", getName(), e);
|
LOG.warn("Couldn't determine stream resolution for {} - {}", getName(), e.getMessage());
|
||||||
}
|
}
|
||||||
return resolution;
|
return resolution;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue