Fix scrcpy() return value

The scrcpy() function returns a SDL_bool to indicate its success, but
was initialized to 0 (SDL_FALSE) instead of SDL_TRUE.
This commit is contained in:
Romain Vimont 2018-02-04 12:20:41 +01:00
parent 82ee55845c
commit 5eb91a4ca7
2 changed files with 2 additions and 4 deletions

View file

@ -183,8 +183,6 @@ static int parse_args(struct args *args, int argc, char *argv[]) {
} }
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
int res;
struct args args = { struct args args = {
.serial = NULL, .serial = NULL,
.help = SDL_FALSE, .help = SDL_FALSE,
@ -210,7 +208,7 @@ int main(int argc, char *argv[]) {
SDL_LogSetAllPriority(SDL_LOG_PRIORITY_DEBUG); SDL_LogSetAllPriority(SDL_LOG_PRIORITY_DEBUG);
res = scrcpy(args.serial, args.port, args.max_size, args.bit_rate) ? 0 : 1; int res = scrcpy(args.serial, args.port, args.max_size, args.bit_rate) ? 0 : 1;
avformat_network_deinit(); // ignore failure avformat_network_deinit(); // ignore failure

View file

@ -519,7 +519,7 @@ void event_loop(void) {
} }
SDL_bool scrcpy(const char *serial, Uint16 local_port, Uint16 max_size, Uint32 bit_rate) { SDL_bool scrcpy(const char *serial, Uint16 local_port, Uint16 max_size, Uint32 bit_rate) {
SDL_bool ret = 0; SDL_bool ret = SDL_TRUE;
process_t push_proc = push_server(serial); process_t push_proc = push_server(serial);
if (wait_for_success(push_proc, "adb push")) { if (wait_for_success(push_proc, "adb push")) {