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

reimar subversion at mplayerhq.hu
Mon Apr 23 20:39:14 CEST 2012


Author: reimar
Date: Mon Apr 23 20:39:14 2012
New Revision: 34873

Log:
Detect prematurely closed connection.

Then we get a streaming_stopped status but we have
a end_pos and have not reached it yet, do not accept
it as EOF but instead try reconnection.
For example a forced restart of a webserver will usually
result in the connection being closed before EOF.

Modified:
   trunk/stream/stream.c

Modified: trunk/stream/stream.c
==============================================================================
--- trunk/stream/stream.c	Sun Apr 22 23:52:39 2012	(r34872)
+++ trunk/stream/stream.c	Mon Apr 23 20:39:14 2012	(r34873)
@@ -310,7 +310,8 @@ int stream_read_internal(stream_t *s, vo
 #ifdef CONFIG_NETWORKING
     if( s->streaming_ctrl!=NULL && s->streaming_ctrl->streaming_read ) {
       len=s->streaming_ctrl->streaming_read(s->fd, buf, len, s->streaming_ctrl);
-      if (s->streaming_ctrl->status == streaming_stopped_e)
+      if (s->streaming_ctrl->status == streaming_stopped_e &&
+          (!s->end_pos || s->pos == s->end_pos))
         s->eof = 1;
     } else
 #endif


More information about the MPlayer-cvslog mailing list