From ac2502141d82bbf4dd25d3bdd33c9d57d79d2d7a Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 29 Aug 2014 11:58:49 +0200 Subject: stream: tweaks to network reconnection code Don't reconnect to the cache (since the cached stream already handles reconnection). This is necessary, because since commit 0b428e44 the "streaming" field (which also controls whether attempting to reconnect makes sense at all) is inherited to the cache stream wrapper. Also, let the stream reset its own position on reconnect. This removes some assumptions and messy handling from the reconnect function. Make sure the cache is dropped on reconnect. This takes care of readjusting the stream position if necessary. (Also drop the cache on DVB channel switching commands.) --- stream/stream_lavf.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'stream/stream_lavf.c') diff --git a/stream/stream_lavf.c b/stream/stream_lavf.c index c84945eba7..afb92f279f 100644 --- a/stream/stream_lavf.c +++ b/stream/stream_lavf.c @@ -252,6 +252,8 @@ 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