On Wed, 27 Mar 2013, Derek Buitenhuis wrote:
On 2013-03-26 9:08 AM, Martin Storsjö wrote:
From: Reimar Döffinger <[email protected]>
In order to match Linux behaviour better our Windows-specific
open() replacement should disable Windows default file locking.
---
[...]
- 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);
According to MSDN[1], you're supposed to lock the bytes[2] before
reading them if you used shared opening. Do we address this anywhere?
- Derek
[1] http://msdn.microsoft.com/en-us/library/w7sa2b22.aspx (See "Example")
[2] http://msdn.microsoft.com/en-us/library/8054ew2f.aspx
I don't see the part saying that you must lock bytes if using this, only
that you can, if you want to.
IIRC I remember reading someone discussing this, and this patch was the
fix for making sure that you can read the output file while it still is
being written. Perhaps not working 100% perfectly, but still probably
better than not letting anybody even open that file at all.
// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel