From 37901469827efed4b13fec40644d6b2de65b0639 Mon Sep 17 00:00:00 2001 From: mplayer-svn Date: Mon, 23 Apr 2012 18:39:14 +0000 Subject: stream: detect prematurely closed connection 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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34873 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar --- stream/stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'stream/stream.c') diff --git a/stream/stream.c b/stream/stream.c index 7af8fa52fa..db389c45c7 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -291,7 +291,8 @@ int stream_read_internal(stream_t *s, void *buf, int len) #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 -- cgit v1.2.3