Skip to content

Commit

Permalink
Do not disable controls without video playback
Browse files Browse the repository at this point in the history
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 92483fe
(semantically).

Fixes #4175 <#4175>
  • Loading branch information
rom1v committed Jul 28, 2023
1 parent 1ee4697 commit 110b3a1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
6 changes: 0 additions & 6 deletions app/src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 1 addition & 3 deletions app/src/scrcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 110b3a1

Please sign in to comment.