Disable controls on --no-mirror

If mirroring is disabled, control must also be disabled.

PR #3978 <https://github.com/Genymobile/scrcpy/pull/3978>
This commit is contained in:
Romain Vimont 2023-05-05 23:45:55 +02:00
parent 6928acdeac
commit 92483fe11b
2 changed files with 11 additions and 1 deletions

View file

@ -2041,6 +2041,15 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
}
#endif
#ifdef HAVE_USB
if (!opts->mirror && opts->control && !opts->otg) {
#else
if (!opts->mirror && opts->control) {
#endif
LOGD("Mirroring is disabled, force --no-control");
opts->control = false;
}
return true;
}

View file

@ -426,7 +426,8 @@ scrcpy(struct scrcpy_options *options) {
struct sc_file_pusher *fp = NULL;
if (options->mirror && options->control) {
assert(!options->control || options->mirror); // control implies mirror
if (options->control) {
if (!sc_file_pusher_init(&s->file_pusher, serial,
options->push_target)) {
goto end;