Skip to content

Display and control your Android device

Initialize screen before starting the stream

Romain Vimontc50b958ee415
diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c
index a671c5e4..f3bfecfb 100644
--- a/app/src/scrcpy.c
+++ b/app/src/scrcpy.c
@@ -366,13 +366,6 @@ scrcpy(const struct scrcpy_options *options) {
stream_init(&stream, server.video_socket, dec, rec);
- // now we consumed the header values, the socket receives the video stream
- // start the stream
- if (!stream_start(&stream)) {
- goto end;
- }
- stream_started = true;
-
if (options->display) {
if (options->control) {
if (!controller_init(&controller, server.control_socket)) {
@@ -415,6 +408,13 @@ scrcpy(const struct scrcpy_options *options) {
}
}
+ // now we consumed the header values, the socket receives the video stream
+ // start the stream
+ if (!stream_start(&stream)) {
+ goto end;
+ }
+ stream_started = true;
+
input_manager_init(&input_manager, options);
ret = event_loop(options);