mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-18 22:14:20 +01:00
Store actual serial in sc_server
Before starting the server, the actual device serial (possibly its ip:port if it's over TCP/IP) must be known. A serial might be requested via -s/--serial (stored in the sc_server_params), but the actual serial may change afterwards: - if none is provided, then it is retrieved with "adb get-serialno"; - if --tcpip is requested, then the final serial will be the target ip:port. The requested serial was overwritten by the actual serial in the sc_server_params struct, which was a bit hacky. Instead, store a separate serial field in sc_server (and rename the one from sc_server_params to "req_serial" to avoid confusion).
This commit is contained in:
@@ -296,7 +296,7 @@ scrcpy(struct scrcpy_options *options) {
|
||||
struct sc_acksync *acksync = NULL;
|
||||
|
||||
struct sc_server_params params = {
|
||||
.serial = options->serial,
|
||||
.req_serial = options->serial,
|
||||
.log_level = options->log_level,
|
||||
.crop = options->crop,
|
||||
.port_range = options->port_range,
|
||||
@@ -355,7 +355,7 @@ scrcpy(struct scrcpy_options *options) {
|
||||
// It is necessarily initialized here, since the device is connected
|
||||
struct sc_server_info *info = &s->server.info;
|
||||
|
||||
const char *serial = s->server.params.serial;
|
||||
const char *serial = s->server.serial;
|
||||
assert(serial);
|
||||
|
||||
struct sc_file_pusher *fp = NULL;
|
||||
|
||||
Reference in New Issue
Block a user