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 4.7.8
======================== ========================
* Fix Stripchat recordings * Fix Stripchat recordings

View File

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