diff mbox series

[FFmpeg-devel,2/2] avformat/file: guard fd_dup by FD_PROTOCOL or PIPE_PROTOCOL

Message ID tencent_E61D277B389B964BCD02206FCDCBCF895507@qq.com
State New
Headers show
Series Add wasi(WebAssembly System Interface) support | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 fail Make failed
andriy/make_x86 fail Make failed

Commit Message

Zhao Zhili June 28, 2024, 4:46 a.m. UTC
From: Zhao Zhili <zhilizhao@tencent.com>

fd_dup is unused when fd and pipe have been disabled. This also
fix build error with wasi since 'dup' isn't available.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
 libavformat/file.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/libavformat/file.c b/libavformat/file.c
index 3fc1e741f2..6a66040b65 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -193,6 +193,7 @@  static int file_check(URLContext *h, int mask)
     return ret;
 }
 
+#if CONFIG_FD_PROTOCOL || CONFIG_PIPE_PROTOCOL
 static int fd_dup(URLContext *h, int oldfd)
 {
     int newfd;
@@ -215,6 +216,7 @@  static int fd_dup(URLContext *h, int oldfd)
 #endif
     return newfd;
 }
+#endif
 
 static int file_close(URLContext *h)
 {