From 8e8b039a633a848bd2498cb6c937ba5d99972cc2 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Mon, 27 Feb 2023 20:03:04 +0100 Subject: [PATCH] Do not use avformat network Scrcpy does not use FFmpeg network features. Initialize network locally instead (useful only for Windows). The include block has been moved to fix the following warning: Please include winsock2.h before windows.h --- app/src/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main.c b/app/src/main.c index b3a468cc..185f1d8f 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -4,10 +4,6 @@ #include #include #include -#ifdef _WIN32 -#include -#include "util/str.h" -#endif #ifdef HAVE_V4L2 # include #endif @@ -19,8 +15,14 @@ #include "scrcpy.h" #include "usb/scrcpy_otg.h" #include "util/log.h" +#include "util/net.h" #include "version.h" +#ifdef _WIN32 +#include +#include "util/str.h" +#endif + int main_scrcpy(int argc, char *argv[]) { #ifdef _WIN32 @@ -69,7 +71,7 @@ main_scrcpy(int argc, char *argv[]) { } #endif - if (avformat_network_init()) { + if (!net_init()) { return SCRCPY_EXIT_FAILURE; } @@ -80,8 +82,6 @@ main_scrcpy(int argc, char *argv[]) { enum scrcpy_exit_code ret = scrcpy(&args.opts); #endif - avformat_network_deinit(); // ignore failure - return ret; }