From e9564f7feaf25b5c0ccd73e835b69a0dbba06786 Mon Sep 17 00:00:00 2001 From: Karthick Jeyapal Date: Mon, 31 Dec 2018 13:07:49 +0530 Subject: [PATCH] avformat/file: Fix file delete for Windows 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 1d321c4205..e613b91010 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);