Copy server params

This is a preliminary step necessary to move the server to a separate
thread.
This commit is contained in:
Romain Vimont
2021-10-27 23:40:52 +02:00
parent 9fa4d1cd4a
commit 882e4cff5f
3 changed files with 72 additions and 26 deletions

View File

@@ -275,10 +275,6 @@ scrcpy(struct scrcpy_options *options) {
atexit(SDL_Quit);
if (!server_init(&s->server)) {
return false;
}
bool ret = false;
bool server_started = false;
@@ -313,7 +309,12 @@ scrcpy(struct scrcpy_options *options) {
.force_adb_forward = options->force_adb_forward,
.power_off_on_close = options->power_off_on_close,
};
if (!server_start(&s->server, &params)) {
if (!server_init(&s->server, &params)) {
return false;
}
if (!server_start(&s->server)) {
goto end;
}
@@ -338,7 +339,7 @@ scrcpy(struct scrcpy_options *options) {
}
if (options->display && options->control) {
if (!file_handler_init(&s->file_handler, s->server.serial,
if (!file_handler_init(&s->file_handler, options->serial,
options->push_target)) {
goto end;
}