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
This commit is contained in:
mplayer-svn 2012-04-23 18:39:14 +00:00 committed by wm4
parent 0dc290269d
commit 3790146982
1 changed files with 2 additions and 1 deletions

View File

@ -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