diff options
author | Niklas Haas <git@nand.wakku.to> | 2015-03-27 13:27:40 +0100 |
---|---|---|
committer | Niklas Haas <git@nand.wakku.to> | 2015-05-27 11:09:41 +0200 |
commit | 4d6b9550fe1e0354461716f560d71d78196d5da5 (patch) | |
tree | c3b819660467c8f48e89616b5e5e2fa46e06c090 /stream | |
parent | bf4dd877e9f1e4508f0031e61c7f40cd612be448 (diff) | |
download | mpv-4d6b9550fe1e0354461716f560d71d78196d5da5.tar.bz2 mpv-4d6b9550fe1e0354461716f560d71d78196d5da5.tar.xz |
vo_opengl: add support for custom shaders
Diffstat (limited to 'stream')
-rw-r--r-- | stream/stream.c | 14 | ||||
-rw-r--r-- | stream/stream.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/stream/stream.c b/stream/stream.c index d6521586b5..35d09ad023 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -929,6 +929,20 @@ struct bstr stream_read_complete(struct stream *s, void *talloc_ctx, return (struct bstr){buf, total_read}; } +struct bstr stream_read_file(const char *filename, void *talloc_ctx, + struct mpv_global *global, int max_size) +{ + struct bstr res = {0}; + char *fname = mp_get_user_path(NULL, global, filename); + stream_t *s = stream_open(fname, global); + if (s) { + res = stream_read_complete(s, talloc_ctx, max_size); + free_stream(s); + } + talloc_free(fname); + return res; +} + struct mp_cancel { atomic_bool triggered; #ifdef __MINGW32__ diff --git a/stream/stream.h b/stream/stream.h index cda5c7434e..981c90cf5e 100644 --- a/stream/stream.h +++ b/stream/stream.h @@ -258,6 +258,8 @@ struct mpv_global; struct bstr stream_read_complete(struct stream *s, void *talloc_ctx, int max_size); +struct bstr stream_read_file(const char *filename, void *talloc_ctx, + struct mpv_global *global, int max_size); int stream_control(stream_t *s, int cmd, void *arg); void free_stream(stream_t *s); struct stream *stream_create(const char *url, int flags, |