mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-12-01 18:24:24 +00:00
Check display mode before streaming
This commit is contained in:
1 parent
7e73de80b3
commit
0e1cabbd82
6 files changed
+79
No files matched your search
@@ -232,6 +232,9 @@ static int load_server_status(PSERVER_DATA server) {
|
||||
if (xml_search(data->memory, data->size, "GfeVersion", (char**) &server->serverInfo.serverInfoGfeVersion) != GS_OK)
|
||||
goto cleanup;
|
||||
|
||||
if (xml_modelist(data->memory, data->size, &server->modes) != GS_OK)
|
||||
goto cleanup;
|
||||
|
||||
// These fields are present on all version of GFE that this client supports
|
||||
if (!strlen(currentGameText) || !strlen(pairedText) || !strlen(server->serverInfo.serverInfoAppVersion) || !strlen(stateText))
|
||||
goto cleanup;
|
||||
@@ -641,6 +644,18 @@ int gs_start_app(PSERVER_DATA server, STREAM_CONFIGURATION *config, int appId, b
|
||||
char* result = NULL;
|
||||
char uuid_str[37];
|
||||
|
||||
PDISPLAY_MODE mode = server->modes;
|
||||
bool correct_mode = false;
|
||||
while (mode != NULL) {
|
||||
if (mode->width == config->width && mode->height == config->height && mode->refresh == config->fps)
|
||||
correct_mode = true;
|
||||
|
||||
mode = mode->next;
|
||||
}
|
||||
|
||||
if (!correct_mode)
|
||||
return GS_NOT_SUPPORTED_MODE;
|
||||
|
||||
if (config->height >= 2160 && !server->supports4K)
|
||||
return GS_NOT_SUPPORTED_4K;
|
||||
|
||||
|
||||
Reference in new issue
Block a user