[MPlayer-cvslog] r32977 - trunk/stream/stream.c

reimar subversion at mplayerhq.hu
Sun Feb 27 15:32:24 CET 2011


Author: reimar
Date: Sun Feb 27 15:32:24 2011
New Revision: 32977

Log:
Improve stream reset on read error, should now fix bug #1841 in more
cases, e.g. also with -cache.

Modified:
   trunk/stream/stream.c

Modified: trunk/stream/stream.c
==============================================================================
--- trunk/stream/stream.c	Sun Feb 27 11:30:04 2011	(r32976)
+++ trunk/stream/stream.c	Sun Feb 27 15:32:24 2011	(r32977)
@@ -309,9 +309,14 @@ int stream_read_internal(stream_t *s, vo
     if (!s->eof) {
       // just in case this is an error e.g. due to network
       // timeout reset and retry
+      // Seeking is used as a hack to make network streams
+      // reopen the connection, ideally they would implement
+      // e.g. a STREAM_CTRL_RECONNECT to do this
       off_t pos = s->pos;
+      s->eof=1;
       stream_reset(s);
       stream_seek_internal(s, pos);
+      // make sure EOF is set to ensure no endless loops
       s->eof=1;
       return stream_read_internal(s, buf, orig_len);
     }


More information about the MPlayer-cvslog mailing list