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

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Wed Apr 15 16:09:27 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
b716adcf by Steve Lhomme at 2026-04-15T17:04:18+02: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

- - - - -


1 changed file:

- src/win32/filesystem.c


Changes:

=====================================
src/win32/filesystem.c
=====================================
@@ -101,7 +101,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/b716adcf73fa372432bf10cd8b66c15f7ed81609

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




More information about the vlc-commits mailing list