summaryrefslogtreecommitdiffstats
path: root/stream/cache.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-06 21:15:21 +0100
committerwm4 <wm4@nowhere>2015-02-06 21:43:52 +0100
commit347cf972310c0de5565015190c1cd6e7d3d3d30c (patch)
tree4aca713ceb59df5e3c25bcf072b6933149ebb9a0 /stream/cache.c
parent45e214d7ae7f1a8cf7af6b43968083b53b25ccb2 (diff)
downloadmpv-347cf972310c0de5565015190c1cd6e7d3d3d30c.tar.bz2
mpv-347cf972310c0de5565015190c1cd6e7d3d3d30c.tar.xz
stream: minor cleanups
Fix return types and return values to make them more consistent. Some reformatting and making code more concise. In stream_reconnect(), avoid the additional mp_cancel_test() call by moving the "connection lost" message below the mp_cancel_wait() call, which effectively leads to the same behavior when the stream was already canceled. (The goal is not to show the message in this case.) Merge stream_seek_long() into stream_seek(). It was the only caller. Always clear the eof flag on seeks. Reduce access to stream internals in cache.c and stream_lavf.c.
Diffstat (limited to 'stream/cache.c')
-rw-r--r--stream/cache.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/stream/cache.c b/stream/cache.c
index 356a49afc7..ccb2f2ca32 100644
--- a/stream/cache.c
+++ b/stream/cache.c
@@ -581,9 +581,8 @@ static int cache_control(stream_t *cache, int cmd, void *arg)
}
r = s->control_res;
if (s->control_flush) {
+ stream_drop_buffers(cache);
cache->pos = s->read_filepos;
- cache->eof = 0;
- cache->buf_pos = cache->buf_len = 0;
}
done: