Use positive options names internally

For clarity, store the flag resulting of the command-line options
--no-control and --no-display into "control" and "display".
This commit is contained in:
Romain Vimont
2019-06-04 21:49:26 +02:00
parent 5b56900e2b
commit c8a6783494
3 changed files with 10 additions and 13 deletions

View File

@@ -294,10 +294,7 @@ scrcpy(const struct scrcpy_options *options) {
bool controller_initialized = false;
bool controller_started = false;
bool display = !options->no_display;
bool control = !options->no_control;
if (!sdl_init_and_configure(display)) {
if (!sdl_init_and_configure(options->display)) {
goto end;
}
@@ -316,13 +313,13 @@ scrcpy(const struct scrcpy_options *options) {
}
struct decoder *dec = NULL;
if (display) {
if (options->display) {
if (!video_buffer_init(&video_buffer)) {
goto end;
}
video_buffer_initialized = true;
if (control) {
if (options->control) {
if (!file_handler_init(&file_handler, server.serial)) {
goto end;
}
@@ -356,8 +353,8 @@ scrcpy(const struct scrcpy_options *options) {
}
stream_started = true;
if (display) {
if (control) {
if (options->display) {
if (options->control) {
if (!controller_init(&controller, server.control_socket)) {
goto end;
}
@@ -382,7 +379,7 @@ scrcpy(const struct scrcpy_options *options) {
show_touches_waited = true;
}
ret = event_loop(display, control);
ret = event_loop(options->display, options->control);
LOGD("quit...");
screen_destroy(&screen);