[FFmpeg-devel] [PATCH v2 3/3] fftools/ffmpeg_demux: fix stdin interaction condition

Zhao Zhili quinkblack at foxmail.com
Sun Dec 11 17:17:29 EET 2022


From: Zhao Zhili <zhilizhao at tencent.com>

Disable stdin interaction for pipe and fd protocols only if the
file descriptor is explicitly or implicitly setting to zero.
---
 fftools/ffmpeg_demux.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index e845e6784d..57695c25a3 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -885,7 +885,10 @@ int ifile_open(const OptionsContext *o, const char *filename)
     if (!strcmp(filename, "-"))
         filename = "pipe:";
 
-    stdin_interaction &= strncmp(filename, "pipe:", 5) &&
+    stdin_interaction &= strcmp(filename, "pipe:") &&
+                         strcmp(filename, "pipe:0") &&
+                         strcmp(filename, "fd:") &&
+                         strcmp(filename, "fd:0") &&
                          strcmp(filename, "/dev/stdin");
 
     /* get default parameters from command line */
-- 
2.25.1



More information about the ffmpeg-devel mailing list