Warn about unsupported resolutions in combination with SOPS

When using unsupported resolutions SOPS will default to 720p60
This commit is contained in:
Iwan Timmer
2020-03-17 22:37:18 +01:00
parent a66d75b145
commit 7f856d3284
3 changed files with 11 additions and 2 deletions

View File

@@ -658,15 +658,21 @@ int gs_start_app(PSERVER_DATA server, STREAM_CONFIGURATION *config, int appId, b
PDISPLAY_MODE mode = server->modes;
bool correct_mode = false;
bool supported_resolution = false;
while (mode != NULL) {
if (mode->width == config->width && mode->height == config->height && mode->refresh == config->fps)
correct_mode = true;
if (mode->width == config->width && mode->height == config->height) {
supported_resolution = true;
if (mode->refresh == config->fps)
correct_mode = true;
}
mode = mode->next;
}
if (!correct_mode && !server->unsupported)
return GS_NOT_SUPPORTED_MODE;
else if (sops && !supported_resolution)
return GS_NOT_SUPPORTED_SOPS_RESOLUTION;
if (config->height >= 2160 && !server->supports4K)
return GS_NOT_SUPPORTED_4K;

View File

@@ -29,5 +29,6 @@
#define GS_UNSUPPORTED_VERSION -7
#define GS_NOT_SUPPORTED_MODE -8
#define GS_ERROR -9
#define GS_NOT_SUPPORTED_SOPS_RESOLUTION -10
extern const char* gs_error;