Fix stream resolution detection for camsoda

This commit is contained in:
0xb00bface 2022-05-27 12:09:19 +02:00
parent bbb829d546
commit e3b54845ff
2 changed files with 8 additions and 5 deletions

View File

@ -1,3 +1,7 @@
4.7.9
========================
* Fix stream resolution detection for Camsoda
4.7.8
========================
* Fix Stripchat recordings

View File

@ -193,10 +193,8 @@ public class CamsodaModel extends AbstractModel {
@Override
public State getOnlineState(boolean failFast) throws IOException, ExecutionException {
if (!failFast) {
if (onlineState == UNKNOWN) {
loadModel();
}
if (!failFast && onlineState == UNKNOWN) {
loadModel();
}
return onlineState;
}
@ -213,10 +211,11 @@ public class CamsodaModel extends AbstractModel {
} else {
try {
List<StreamSource> sources = getStreamSources();
LOG.debug("stream sources {}", sources);
if (sources.isEmpty()) {
return new int[]{0, 0};
} else {
StreamSource src = sources.get(0);
StreamSource src = sources.get(sources.size() - 1);
resolution = new int[]{src.width, src.height};
return resolution;
}