diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2012-08-22 18:24:56 +0000 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-10-30 19:50:18 +0100 |
commit | ff08d0c34af0dda7913445cf73e39a549658ab1f (patch) | |
tree | d39bb25207593a6bce72279abbc6eaa1b2cd856a /stream/stream_file.c | |
parent | 5104699646c2a53263faf93f537e759b5d1c5fe6 (diff) | |
download | mpv-ff08d0c34af0dda7913445cf73e39a549658ab1f.tar.bz2 mpv-ff08d0c34af0dda7913445cf73e39a549658ab1f.tar.xz |
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
Diffstat (limited to 'stream/stream_file.c')
-rw-r--r-- | stream/stream_file.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/stream/stream_file.c b/stream/stream_file.c index dfafb773f0..20d2a85497 100644 --- a/stream/stream_file.c +++ b/stream/stream_file.c @@ -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; } |