From 347cf972310c0de5565015190c1cd6e7d3d3d30c Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 6 Feb 2015 21:15:21 +0100 Subject: 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. --- stream/stream_lavf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'stream/stream_lavf.c') diff --git a/stream/stream_lavf.c b/stream/stream_lavf.c index 079bb4e550..1b9f7363ae 100644 --- a/stream/stream_lavf.c +++ b/stream/stream_lavf.c @@ -134,6 +134,8 @@ static int control(stream_t *s, int cmd, void *arg) // avio doesn't seem to support this - emulate it by reopening close_f(s); s->priv = NULL; + stream_drop_buffers(s); + s->pos = 0; return open_f(s); } } @@ -291,8 +293,6 @@ static int open_f(stream_t *stream) stream->close = close_f; // enable cache (should be avoided for files, but no way to detect this) stream->streaming = true; - stream->pos = 0; // reset specifically for STREAM_CTRL_RECONNECT - stream->buf_pos = stream->buf_len = 0; res = STREAM_OK; out: -- cgit v1.2.3