Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2012-01-20 23:27:22 +0400
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2012-02-18 15:26:35 +0400
commitad8173eb818a4de4fc61ac1b3ede886316f20eb5 (patch)
treea82fd2f6a8d79fb7f668be0573c3f1ccfc38b822 /libavformat/os_support.c
parent7c8d477299c9b5e89fc30ed22f9e42b50761342c (diff)
Allow other programs to open the same files on Windows.
In order to match Linux behaviour better our Windows-specific open() replacement should disable Windows default file locking. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavformat/os_support.c')
-rw-r--r--libavformat/os_support.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/os_support.c b/libavformat/os_support.c
index 467053e196..913ca539c8 100644
--- a/libavformat/os_support.c
+++ b/libavformat/os_support.c
@@ -29,6 +29,7 @@
#if defined(_WIN32) && !defined(__MINGW32CE__)
#include <windows.h>
+#include <share.h>
#undef open
int ff_win32_open(const char *filename_utf8, int oflag, int pmode)
@@ -44,12 +45,12 @@ int ff_win32_open(const char *filename_utf8, int oflag, int pmode)
filename_w = av_mallocz(sizeof(wchar_t) * num_chars);
MultiByteToWideChar(CP_UTF8, 0, filename_utf8, -1, filename_w, num_chars);
- fd = _wopen(filename_w, oflag, pmode);
+ fd = _wsopen(filename_w, oflag, SH_DENYNO, pmode);
av_freep(&filename_w);
/* filename maybe be in CP_ACP */
if (fd == -1 && !(oflag & O_CREAT))
- return open(filename_utf8, oflag, pmode);
+ return _sopen(filename_utf8, oflag, SH_DENYNO, pmode);
return fd;
}