[vlc-commits] [Git][videolan/vlc][3.0.x] win32: do not use FILE_FLAG_RANDOM_ACCESS with vlc_open()

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Apr 21 15:24:17 UTC 2026



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
7719f6ec by Steve Lhomme at 2026-04-21T13:15:01+00:00
win32: do not use FILE_FLAG_RANDOM_ACCESS with vlc_open()

Prior to 73950592f883ff237173837c5574416cb3d0beec _wopen() opened files with
no particular caching hint. The FILE_FLAG_RANDOM_ACCESS limits caching of files.

We should not use this flag or any other caching flag [^2] to be closer to the
behavior we had before 73950592f883ff237173837c5574416cb3d0beec.
For example FILE_FLAG_SEQUENTIAL_SCAN might be beneficial to read videos
but it may impact reading the index or other types of files.

[^1]: https://devblogs.microsoft.com/oldnewthing/20120120-00/?p=8493
[^2]: https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea#caching_behavior

(cherry picked from commit b716adcf73fa372432bf10cd8b66c15f7ed81609)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -


1 changed file:

- src/win32/filesystem.c


Changes:

=====================================
src/win32/filesystem.c
=====================================
@@ -107,7 +107,7 @@ int vlc_open (const char *filename, int flags, ...)
         dwCreationDisposition = OPEN_EXISTING;
     }
 
-    dwFlagsAndAttributes = FILE_FLAG_RANDOM_ACCESS | SECURITY_SQOS_PRESENT | SECURITY_IDENTIFICATION;
+    dwFlagsAndAttributes = SECURITY_SQOS_PRESENT | SECURITY_IDENTIFICATION;
 
     // if (flags & O_NONBLOCK)
     //     dwFlagsAndAttributes |= FILE_FLAG_OVERLAPPED;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7719f6ecc3a457476936405d0b1f06c26810bf49

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7719f6ecc3a457476936405d0b1f06c26810bf49
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list