From e7b7b083aad8c2e016cd5207988f5775cdaa19e9 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sat, 2 Mar 2019 18:18:12 +0100 Subject: [PATCH] Store the recording request in a local bool This avoids to test explicitly whether options->record_filename is NULL. --- app/src/scrcpy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c index ed91479d..6880ee90 100644 --- a/app/src/scrcpy.c +++ b/app/src/scrcpy.c @@ -174,10 +174,10 @@ av_log_callback(void *avcl, int level, const char *fmt, va_list vl) { } SDL_bool scrcpy(const struct scrcpy_options *options) { - SDL_bool send_frame_meta = !!options->record_filename; + SDL_bool record = !!options->record_filename; if (!server_start(&server, options->serial, options->port, options->max_size, options->bit_rate, options->crop, - send_frame_meta)) { + record)) { return SDL_FALSE; } @@ -228,7 +228,7 @@ SDL_bool scrcpy(const struct scrcpy_options *options) { } struct recorder *rec = NULL; - if (options->record_filename) { + if (record) { if (!recorder_init(&recorder, options->record_filename, options->record_format, @@ -292,7 +292,7 @@ finally_stop_decoder: server_stop(&server); decoder_join(&decoder); finally_destroy_recorder: - if (options->record_filename) { + if (record) { recorder_destroy(&recorder); } finally_destroy_file_handler: