Skip to content

Commit

Permalink
Increase display id range
Browse files Browse the repository at this point in the history
Some devices use big display id values.

Refs #2009 <#2009>
  • Loading branch information
rom1v committed Jan 4, 2021
1 parent ed130e0 commit aa8b571
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions app/src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,14 +478,14 @@ parse_port_range(const char *s, struct sc_port_range *port_range) {
}

static bool
parse_display_id(const char *s, uint16_t *display_id) {
parse_display_id(const char *s, uint32_t *display_id) {
long value;
bool ok = parse_integer_arg(s, &value, false, 0, 0xFFFF, "display id");
bool ok = parse_integer_arg(s, &value, false, 0, 0x7FFFFFFF, "display id");
if (!ok) {
return false;
}

*display_id = (uint16_t) value;
*display_id = (uint32_t) value;
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/scrcpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct scrcpy_options {
int16_t window_y; // SC_WINDOW_POSITION_UNDEFINED for "auto"
uint16_t window_width;
uint16_t window_height;
uint16_t display_id;
uint32_t display_id;
bool show_touches;
bool fullscreen;
bool always_on_top;
Expand Down
4 changes: 2 additions & 2 deletions app/src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,12 @@ execute_server(struct server *server, const struct server_params *params) {
char bit_rate_string[11];
char max_fps_string[6];
char lock_video_orientation_string[5];
char display_id_string[6];
char display_id_string[11];
sprintf(max_size_string, "%"PRIu16, params->max_size);
sprintf(bit_rate_string, "%"PRIu32, params->bit_rate);
sprintf(max_fps_string, "%"PRIu16, params->max_fps);
sprintf(lock_video_orientation_string, "%"PRIi8, params->lock_video_orientation);
sprintf(display_id_string, "%"PRIu16, params->display_id);
sprintf(display_id_string, "%"PRIu32, params->display_id);
const char *const cmd[] = {
"shell",
"CLASSPATH=" DEVICE_SERVER_PATH,
Expand Down
2 changes: 1 addition & 1 deletion app/src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct server_params {
uint16_t max_fps;
int8_t lock_video_orientation;
bool control;
uint16_t display_id;
uint32_t display_id;
bool show_touches;
bool stay_awake;
bool force_adb_forward;
Expand Down

0 comments on commit aa8b571

Please sign in to comment.