forked from j62/ctbrec
1
0
Fork 0

Don't fetch stream resolution if model is offline

This commit is contained in:
0xboobface 2018-11-09 14:30:30 +01:00
parent 8ee3d8b588
commit b447c76dac
1 changed files with 5 additions and 2 deletions

View File

@ -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 {