mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-20 07:10:32 +00:00
Allow unsupported version to try to run
This commit is contained in:
@@ -65,6 +65,7 @@ static struct option long_options[] = {
|
|||||||
{"fps", required_argument, NULL, 'v'},
|
{"fps", required_argument, NULL, 'v'},
|
||||||
{"forcehw", no_argument, NULL, 'w'},
|
{"forcehw", no_argument, NULL, 'w'},
|
||||||
{"forcehevc", no_argument, NULL, 'x'},
|
{"forcehevc", no_argument, NULL, 'x'},
|
||||||
|
{"unsupported", no_argument, NULL, 'y'},
|
||||||
{0, 0, 0, 0},
|
{0, 0, 0, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -205,6 +206,9 @@ static void parse_argument(int c, char* value, PCONFIGURATION config) {
|
|||||||
case 'x':
|
case 'x':
|
||||||
config->stream.supportsHevc = true;
|
config->stream.supportsHevc = true;
|
||||||
break;
|
break;
|
||||||
|
case 'y':
|
||||||
|
config->unsupported_version = true;
|
||||||
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (config->action == NULL)
|
if (config->action == NULL)
|
||||||
config->action = value;
|
config->action = value;
|
||||||
@@ -296,6 +300,7 @@ void config_parse(int argc, char* argv[], PCONFIGURATION config) {
|
|||||||
config->sops = true;
|
config->sops = true;
|
||||||
config->localaudio = false;
|
config->localaudio = false;
|
||||||
config->fullscreen = true;
|
config->fullscreen = true;
|
||||||
|
config->unsupported_version = false;
|
||||||
|
|
||||||
config->inputsCount = 0;
|
config->inputsCount = 0;
|
||||||
config->mapping = get_path("mappings/default.conf", getenv("XDG_DATA_DIRS"));
|
config->mapping = get_path("mappings/default.conf", getenv("XDG_DATA_DIRS"));
|
||||||
@@ -313,7 +318,7 @@ void config_parse(int argc, char* argv[], PCONFIGURATION config) {
|
|||||||
} else {
|
} else {
|
||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
int c;
|
int c;
|
||||||
while ((c = getopt_long_only(argc, argv, "-abc:d:efg:h:i:j:k:lm:no:p:q:r:stuv:w:x", long_options, &option_index)) != -1) {
|
while ((c = getopt_long_only(argc, argv, "-abc:d:efg:h:i:j:k:lm:no:p:q:r:stuv:w:xy", long_options, &option_index)) != -1) {
|
||||||
parse_argument(c, optarg, config);
|
parse_argument(c, optarg, config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of Moonlight Embedded.
|
* This file is part of Moonlight Embedded.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Iwan Timmer
|
* Copyright (C) 2015, 2016 Iwan Timmer
|
||||||
*
|
*
|
||||||
* Moonlight is free software; you can redistribute it and/or modify
|
* Moonlight is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -41,6 +41,7 @@ typedef struct _CONFIGURATION {
|
|||||||
bool localaudio;
|
bool localaudio;
|
||||||
bool fullscreen;
|
bool fullscreen;
|
||||||
bool forcehw;
|
bool forcehw;
|
||||||
|
bool unsupported_version;
|
||||||
struct input_config inputs[MAX_INPUTS];
|
struct input_config inputs[MAX_INPUTS];
|
||||||
int inputsCount;
|
int inputsCount;
|
||||||
} CONFIGURATION, *PCONFIGURATION;
|
} CONFIGURATION, *PCONFIGURATION;
|
||||||
|
|||||||
@@ -227,8 +227,10 @@ int main(int argc, char* argv[]) {
|
|||||||
fprintf(stderr, "Invalid data received from server: %s\n", config.address, gs_error);
|
fprintf(stderr, "Invalid data received from server: %s\n", config.address, gs_error);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
} else if (ret == GS_UNSUPPORTED_VERSION) {
|
} else if (ret == GS_UNSUPPORTED_VERSION) {
|
||||||
fprintf(stderr, "Unsupported version: %s\n", gs_error);
|
if (!config.unsupported_version) {
|
||||||
exit(-1);
|
fprintf(stderr, "Unsupported version: %s\n", gs_error);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
} else if (ret != GS_OK) {
|
} else if (ret != GS_OK) {
|
||||||
fprintf(stderr, "Can't connect to server %s\n", config.address);
|
fprintf(stderr, "Can't connect to server %s\n", config.address);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user