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
856struct bstr stream_read_file(const char *filename, void *talloc_ctx,856struct bstr stream_read_file(const char *filename, void *talloc_ctx,
857 struct mpv_global *global, int max_size)857 struct mpv_global *global, int max_size)
858{858{
859 int flags = STREAM_ORIGIN_DIRECT | STREAM_READ | STREAM_LOCAL_FS_ONLY |859 return stream_read_file2(filename, talloc_ctx, STREAM_READ_FILE_FLAGS_DEFAULT,
860 STREAM_LESS_NOISE;860 global, max_size);
861 return stream_read_file2(filename, talloc_ctx, flags, global, max_size);
862}861}
863 862
864struct bstr stream_read_file2(const char *filename, void *talloc_ctx,863struct bstr stream_read_file2(const char *filename, void *talloc_ctx,
stream/stream.h+4−0
@@ -55,6 +55,10 @@ · 54 unmodified lines
55#define STREAM_LESS_NOISE (1 << 6) // try to log errors only55#define STREAM_LESS_NOISE (1 << 6) // try to log errors only
56#define STREAM_ALLOW_PARTIAL_READ (1 << 7) // allows partial read with stream_read_file()56#define STREAM_ALLOW_PARTIAL_READ (1 << 7) // allows partial read with stream_read_file()
57 57
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
58// end flags for stream_open_ext (the naming convention sucks)62// end flags for stream_open_ext (the naming convention sucks)
59 63
60#define STREAM_UNSAFE -364#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