Pass NULL controller if control is disabled
If --no-control is requested, then the controller instance is not initialized. However, its reference was still passed to screen and input_manager. Instead, pass NULL if no controller is available.
This commit is contained in:
parent
0b8e926330
commit
557daf280e
1 changed files with 3 additions and 1 deletions
|
@ -405,6 +405,7 @@ scrcpy(struct scrcpy_options *options) {
|
||||||
stream_add_sink(&s->stream, &rec->packet_sink);
|
stream_add_sink(&s->stream, &rec->packet_sink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct sc_controller *controller = NULL;
|
||||||
struct sc_key_processor *kp = NULL;
|
struct sc_key_processor *kp = NULL;
|
||||||
struct sc_mouse_processor *mp = NULL;
|
struct sc_mouse_processor *mp = NULL;
|
||||||
|
|
||||||
|
@ -510,6 +511,7 @@ aoa_hid_end:
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
controller_started = true;
|
controller_started = true;
|
||||||
|
controller = &s->controller;
|
||||||
|
|
||||||
if (options->turn_screen_off) {
|
if (options->turn_screen_off) {
|
||||||
struct sc_control_msg msg;
|
struct sc_control_msg msg;
|
||||||
|
@ -528,7 +530,7 @@ aoa_hid_end:
|
||||||
options->window_title ? options->window_title : info->device_name;
|
options->window_title ? options->window_title : info->device_name;
|
||||||
|
|
||||||
struct sc_screen_params screen_params = {
|
struct sc_screen_params screen_params = {
|
||||||
.controller = &s->controller,
|
.controller = controller,
|
||||||
.fp = fp,
|
.fp = fp,
|
||||||
.kp = kp,
|
.kp = kp,
|
||||||
.mp = mp,
|
.mp = mp,
|
||||||
|
|
Loading…
Reference in a new issue