From 110b3a16f6d02124a4567d2ab79fcb74d78f949f Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 28 Jul 2023 14:45:33 +0200 Subject: [PATCH] Do not disable controls without video playback Some control messages can still be used even when video playback is disabled (i.e. there is no window), for example to turn the screen off. This reverts commit 92483fe11b6fd6bae5ef775ccaff78fefa92aad4 (semantically). Fixes #4175 --- app/src/cli.c | 6 ------ app/src/scrcpy.c | 4 +--- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/src/cli.c b/app/src/cli.c index 37a98426..09f853f5 100644 --- a/app/src/cli.c +++ b/app/src/cli.c @@ -2022,12 +2022,6 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[], opts->audio_playback = false; } - if (!opts->video_playback && !otg) { - // If video playback is disabled and OTG are disabled, then there is - // no way to control the device. - opts->control = false; - } - if (opts->video && !opts->video_playback && !opts->record_filename && !v4l2) { LOGI("No video playback, no recording, no V4L2 sink: video disabled"); diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c index fd310c46..d68a2424 100644 --- a/app/src/scrcpy.c +++ b/app/src/scrcpy.c @@ -448,9 +448,7 @@ scrcpy(struct scrcpy_options *options) { struct sc_file_pusher *fp = NULL; - // control implies video playback - assert(!options->control || options->video_playback); - if (options->control) { + if (options->video_playback && options->control) { if (!sc_file_pusher_init(&s->file_pusher, serial, options->push_target)) { goto end;