[FFmpeg-devel] [PATCH] avformat/file: Fix file delete for Windows

Karthick J kjeyapal at akamai.com
Mon Dec 31 09:37:49 EET 2018


From: Karthick Jeyapal <kjeyapal at akamai.com>

Fixes bug id : 7638
---
 libavformat/file.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/file.c b/libavformat/file.c
index 1d321c4..e613b91 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -173,7 +173,11 @@ static int file_delete(URLContext *h)
     av_strstart(filename, "file:", &filename);
 
     ret = rmdir(filename);
-    if (ret < 0 && errno == ENOTDIR)
+    if (ret < 0 && (errno == ENOTDIR
+#   ifdef _WIN32
+        || errno == EINVAL
+#   endif
+        ))
         ret = unlink(filename);
     if (ret < 0)
         return AVERROR(errno);
-- 
2.7.4



More information about the ffmpeg-devel mailing list