[FileSystem] deprecate use of READ_CHUNKED flag #25158
Open
+41
−34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
[FileSystem] deprecate use of READ_CHUNKED flag
This is a follow up of #25128 or better alternative as fixes the same in more elaborated way. Also fixes other potential issues or "unwanted behavior changes" due the main refactor in StreamBuffer logic.
Motivation and context
As commented in the other PR,
READ_AUDIO_VIDEO
flag fits better intoCFile::ShouldUseStreamBuffer
method because same as FileCache, StreamBuffer only should be used in audio/video files.Once replaced here results that
READ_CHUNKED
flag is a dead code because only is set but never read/used. Then can be deprecated.The others changes are only small adjustments to maintain the same functionality and some potential fix.
How has this been tested?
Runtime Windows x64 and Shield
Tested that use of FileCache and StreamBuffer is maintained same as before for most habitual scenarios: tested MKV's local/network SMB, NFS. Tested Blu-Ray BDMV folders and ISOs SMB and NFS. Adequate chunk size is used same as before: 128K on network and 6144 bytes locally. Tested DVD, DVD ISOs.
Fix for external SRT is preserved without needing to use the
READ_NO_BUFFER
flag since when opening subtitles it does not have theREAD_AUDIO_VIDEO
flag and the file size >200 MB condition is not met either.What is the effect on users?
Nothing directly but prevents other potentially cases of StreamBuffer used on file contents that are not suitable (non audio/video files).
Types of change
Checklist: