avformat/file: Fix file delete for Windows

Fixes bug id : 7638
This commit is contained in:
Karthick Jeyapal 2018-12-31 13:07:49 +05:30 committed by Karthick J
parent ab160efa28
commit e9564f7fea
1 changed files with 5 additions and 1 deletions

View File

@ -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);