mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-07-01 23:35:47 +00:00
Determine platform only when stream is started
This commit is contained in:
parent
1ed34ff95d
commit
c9a3370db9
21
src/main.c
21
src/main.c
@ -185,16 +185,6 @@ int main(int argc, char* argv[]) {
|
|||||||
if (config.action == NULL || strcmp("help", config.action) == 0)
|
if (config.action == NULL || strcmp("help", config.action) == 0)
|
||||||
help();
|
help();
|
||||||
|
|
||||||
enum platform system = platform_check(config.platform);
|
|
||||||
if (system == 0) {
|
|
||||||
fprintf(stderr, "Platform '%s' not found\n", config.platform);
|
|
||||||
exit(-1);
|
|
||||||
} else if (system == SDL && config.audio_device != NULL) {
|
|
||||||
fprintf(stderr, "You can't select a audio device for SDL\n");
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
config.stream.supportsHevc = config.codec != CODEC_H264 && (config.codec == CODEC_HEVC || platform_supports_hevc(system));
|
|
||||||
|
|
||||||
if (config.address == NULL) {
|
if (config.address == NULL) {
|
||||||
config.address = malloc(MAX_ADDRESS_SIZE);
|
config.address = malloc(MAX_ADDRESS_SIZE);
|
||||||
if (config.address == NULL) {
|
if (config.address == NULL) {
|
||||||
@ -242,6 +232,17 @@ int main(int argc, char* argv[]) {
|
|||||||
applist(&server);
|
applist(&server);
|
||||||
} else if (strcmp("stream", config.action) == 0) {
|
} else if (strcmp("stream", config.action) == 0) {
|
||||||
pair_check(&server);
|
pair_check(&server);
|
||||||
|
enum platform system = platform_check(config.platform);
|
||||||
|
|
||||||
|
if (system == 0) {
|
||||||
|
fprintf(stderr, "Platform '%s' not found\n", config.platform);
|
||||||
|
exit(-1);
|
||||||
|
} else if (system == SDL && config.audio_device != NULL) {
|
||||||
|
fprintf(stderr, "You can't select a audio device for SDL\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
config.stream.supportsHevc = config.codec != CODEC_H264 && (config.codec == CODEC_HEVC || platform_supports_hevc(system));
|
||||||
|
|
||||||
if (IS_EMBEDDED(system)) {
|
if (IS_EMBEDDED(system)) {
|
||||||
struct mapping* mappings = mapping_load(config.mapping);
|
struct mapping* mappings = mapping_load(config.mapping);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user