lavf: Don't try to update files atomically with renames on windows

On windows, rename(2) will fail if the target file exists. On
unix this trick is used to make sure that people reading the file
either will get the full previous file, or the full new version
of the file, but no intermediate version.

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö
2014-11-18 14:06:19 +02:00
parent 40665d27e3
commit b9d08c77a4
4 changed files with 30 additions and 14 deletions

View File

@@ -365,4 +365,10 @@ static inline int ff_rename(const char *oldpath, const char *newpath)
return 0;
}
#ifndef _WIN32
#define USE_RENAME_REPLACE 1
#else
#define USE_RENAME_REPLACE 0
#endif
#endif /* AVFORMAT_INTERNAL_H */