From 8a7b8c3dd6ddb58adb221cfd194c57457a40839c Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 24 Jan 2013 18:45:24 +0100 Subject: stream: fix reconnecting on broken network connections This didn't work properly for HTTP with libavformat. The builtin HTTP implementation reconnects automatically on its own, while libavformat doesn't. Fix this by adding explicit reconnection support to stream_lavf.c, which simply destroys and recreates the AVIO context. It mostly works, though sometimes it mysteriously fails, spamming crap all over the terminal and feeding broken data to the decoders. This is probably due to itneractions with the cache. Also, reconnecting to unseekable HTTP streams will make it read the entire stream until the previous playback position is reached again. It's not known whether this change makes behavior with "strange" protocols like RTP better or worse. --- stream/stream.h | 1 + 1 file changed, 1 insertion(+) (limited to 'stream/stream.h') diff --git a/stream/stream.h b/stream/stream.h index 4beefc91bd..746667c564 100644 --- a/stream/stream.h +++ b/stream/stream.h @@ -101,6 +101,7 @@ #define STREAM_CTRL_GET_CACHE_SIZE 15 #define STREAM_CTRL_GET_CACHE_FILL 16 #define STREAM_CTRL_GET_CACHE_IDLE 17 +#define STREAM_CTRL_RECONNECT 18 struct stream_lang_req { int type; // STREAM_AUDIO, STREAM_SUB -- cgit v1.2.3