Skip to content

Commit f5f2edd

Browse files
committed
Move await_for_server() logs
Print the logs on the caller side. This will allow to call the function in another context without printing the logs. PR #3757 <Genymobile/scrcpy#3757>
1 parent dce8cf5 commit f5f2edd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/src/scrcpy.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,11 @@ await_for_server(bool *connected) {
183183
while (SDL_WaitEvent(&event)) {
184184
switch (event.type) {
185185
case SDL_QUIT:
186-
LOGD("User requested to quit");
187186
*connected = false;
188187
return true;
189188
case SC_EVENT_SERVER_CONNECTION_FAILED:
190-
LOGE("Server connection failed");
191189
return false;
192190
case SC_EVENT_SERVER_CONNECTED:
193-
LOGD("Server connected");
194191
*connected = true;
195192
return true;
196193
default:
@@ -374,15 +371,19 @@ scrcpy(struct scrcpy_options *options) {
374371
// Await for server without blocking Ctrl+C handling
375372
bool connected;
376373
if (!await_for_server(&connected)) {
374+
LOGE("Server connection failed");
377375
goto end;
378376
}
379377

380378
if (!connected) {
381379
// This is not an error, user requested to quit
380+
LOGD("User requested to quit");
382381
ret = SCRCPY_EXIT_SUCCESS;
383382
goto end;
384383
}
385384

385+
LOGD("Server connected");
386+
386387
// It is necessarily initialized here, since the device is connected
387388
struct sc_server_info *info = &s->server.info;
388389

0 commit comments

Comments
 (0)