This is the default set of flags used by stream_read_file(). Useful for doing flag customization for stream_read_file2().
Unified · Split
| @@ -856,9 +856,8 @@ struct bstr stream_read_complete(struct stream *s, void *talloc_ctx, · 855 unmodified lines | |||
| 856 | struct bstr stream_read_file(const char *filename, void *talloc_ctx, | 856 | struct 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 | ||
| 864 | struct bstr stream_read_file2(const char *filename, void *talloc_ctx, | 863 | struct bstr stream_read_file2(const char *filename, void *talloc_ctx, |
| @@ -55,6 +55,10 @@ · 54 unmodified lines | |||
| 55 | #define STREAM_LESS_NOISE (1 << 6) // try to log errors only | 55 | #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 -3 | 64 | #define STREAM_UNSAFE -3 |