mirror of https://github.com/mpv-player/mpv
stream_file: explicitly signal EOF
Explicitly signal EOF when reaching the end of a file/pipe. Fixes a 4 second delay due to stream_reconnect for e.g. echo | mplayer - git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35112 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
5104699646
commit
ff08d0c34a
|
@ -55,6 +55,8 @@ static const struct m_struct_st stream_opts = {
|
|||
|
||||
static int fill_buffer(stream_t *s, char* buffer, int max_len){
|
||||
int r = read(s->fd,buffer,max_len);
|
||||
// We are certain this is EOF, do not retry
|
||||
if (max_len && r == 0) s->eof = 1;
|
||||
return (r <= 0) ? -1 : r;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue