summaryrefslogtreecommitdiffstats
path: root/stream/stream.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-07 20:45:39 +0200
committerwm4 <wm4@nowhere>2014-09-07 20:45:39 +0200
commit8c7a9b0cd0c53a03f4c1e72cacd6e746fb9c589a (patch)
tree97713d6644f2b4e594f2de75a7b342f7bf97fd76 /stream/stream.c
parentf5af5962378bd40a409716434a6a4d312e50c755 (diff)
downloadmpv-8c7a9b0cd0c53a03f4c1e72cacd6e746fb9c589a.tar.bz2
mpv-8c7a9b0cd0c53a03f4c1e72cacd6e746fb9c589a.tar.xz
stream: change cache return values
Basically a cosmetic change, because currently the player just continues even if the cache fails initializing.
Diffstat (limited to 'stream/stream.c')
-rw-r--r--stream/stream.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/stream/stream.c b/stream/stream.c
index 455c0a5409..e2f71ae58f 100644
--- a/stream/stream.c
+++ b/stream/stream.c
@@ -827,15 +827,15 @@ bool stream_wants_cache(stream_t *stream, struct mp_cache_opts *opts)
return use_opts.size > 0;
}
-// return: 1 on success, 0 if the function was interrupted and -1 on error, or
-// if the cache is disabled
+// return 1 on success, 0 if the cache is disabled/not needed, and -1 on error
+// or if the cache is disabled
int stream_enable_cache(stream_t **stream, struct mp_cache_opts *opts)
{
stream_t *orig = *stream;
struct mp_cache_opts use_opts = check_cache_opts(*stream, opts);
if (use_opts.size < 1)
- return -1;
+ return 0;
stream_t *fcache = open_cache(orig, "file-cache");
if (stream_file_cache_init(fcache, orig, &use_opts) <= 0) {