diff options
author | wm4 <wm4@nowhere> | 2014-09-07 20:45:39 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-09-07 20:45:39 +0200 |
commit | 8c7a9b0cd0c53a03f4c1e72cacd6e746fb9c589a (patch) | |
tree | 97713d6644f2b4e594f2de75a7b342f7bf97fd76 /stream/cache.c | |
parent | f5af5962378bd40a409716434a6a4d312e50c755 (diff) | |
download | mpv-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/cache.c')
-rw-r--r-- | stream/cache.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/stream/cache.c b/stream/cache.c index 90683aa6db..81408e098b 100644 --- a/stream/cache.c +++ b/stream/cache.c @@ -599,13 +599,13 @@ static void cache_uninit(stream_t *cache) talloc_free(s); } -// 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_cache_init(stream_t *cache, stream_t *stream, struct mp_cache_opts *opts) { if (opts->size < 1) - return -1; + return 0; struct priv *s = talloc_zero(NULL, struct priv); s->log = cache->log; @@ -653,7 +653,7 @@ int stream_cache_init(stream_t *cache, stream_t *stream, return 1; for (;;) { if (stream_check_interrupt(cache)) - return 0; + return -1; int64_t fill; int idle; if (stream_control(s->cache, STREAM_CTRL_GET_CACHE_FILL, &fill) < 0) |