Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

try fix FFmpeg amf encode hang (#10283)

21pagesacae6d6558a7
diff --git a/res/vcpkg/ffmpeg/patch/0008-remove-amf-loop-query.patch b/res/vcpkg/ffmpeg/patch/0008-remove-amf-loop-query.patch
new file mode 100644
index 000000000..fe08aebda
--- /dev/null
+++ b/res/vcpkg/ffmpeg/patch/0008-remove-amf-loop-query.patch
@@ -0,0 +1,26 @@
+From 1440f556234d135ce58a2ef38916c6a63b05870e Mon Sep 17 00:00:00 2001
+From: 21pages <[email protected]>
+Date: Sat, 14 Dec 2024 21:39:44 +0800
+Subject: [PATCH] remove amf loop query
+
+Signed-off-by: 21pages <[email protected]>
+---
+ libavcodec/amfenc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavcodec/amfenc.c b/libavcodec/amfenc.c
+index f70f0109f6..a53a05b16b 100644
+--- a/libavcodec/amfenc.c
++++ b/libavcodec/amfenc.c
+@@ -886,7 +886,7 @@ int ff_amf_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
+ av_usleep(1000);
+ }
+ }
+- } while (block_and_wait);
++ } while (false); // already set query timeout
+
+ if (res_query == AMF_EOF) {
+ ret = AVERROR_EOF;
+--
+2.43.0.windows.1
+
diff --git a/res/vcpkg/ffmpeg/portfile.cmake b/res/vcpkg/ffmpeg/portfile.cmake
index e7a530ee6..b8e05e211 100644
--- a/res/vcpkg/ffmpeg/portfile.cmake
+++ b/res/vcpkg/ffmpeg/portfile.cmake
@@ -23,6 +23,7 @@ vcpkg_from_github(
patch/0005-mediacodec-changing-bitrate.patch
patch/0006-dlopen-libva.patch
patch/0007-fix-linux-configure.patch
+ patch/0008-remove-amf-loop-query.patch
)
if(SOURCE_PATH MATCHES " ")