History

stream: add STREAM_READ_FILE_FLAGS_DEFAULT

This is the default set of flags used by stream_read_file(). Useful for doing flag customization for stream_read_file2().

nanahi committed 2 years ago

Commit dc0d99e1 parent c2e71ce2 files · +6 −3Browse files

Unified · Split

2 files
  1. stream/stream.c +2 −3
  2. stream/stream.h +4 −0
stream/stream.c+2−3
@@ -856,9 +856,8 @@ struct bstr stream_read_complete(struct stream *s, void *talloc_ctx, · 855 unmodified lines
856856 struct bstr stream_read_file(const char *filename, void *talloc_ctx,
857857 struct mpv_global *global, int max_size)
858858 {
859− int flags = STREAM_ORIGIN_DIRECT | STREAM_READ | STREAM_LOCAL_FS_ONLY |
860− STREAM_LESS_NOISE;
861− return stream_read_file2(filename, talloc_ctx, flags, global, max_size);
859+ return stream_read_file2(filename, talloc_ctx, STREAM_READ_FILE_FLAGS_DEFAULT,
860+ global, max_size);
862861 }
863862
864863 struct bstr stream_read_file2(const char *filename, void *talloc_ctx,
stream/stream.h+4−0
@@ -55,6 +55,10 @@ · 54 unmodified lines
5555 #define STREAM_LESS_NOISE (1 << 6) // try to log errors only
5656 #define STREAM_ALLOW_PARTIAL_READ (1 << 7) // allows partial read with stream_read_file()
5757
58+// Default flags used by stream_read_file().
59+#define STREAM_READ_FILE_FLAGS_DEFAULT \
60+ (STREAM_ORIGIN_DIRECT | STREAM_READ | STREAM_LOCAL_FS_ONLY | STREAM_LESS_NOISE)
61+
5862 // end flags for stream_open_ext (the naming convention sucks)
5963
6064 #define STREAM_UNSAFE -3

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t