[MPlayer-cvslog] r35112 - trunk/stream/stream_file.c

reimar subversion at mplayerhq.hu
Wed Aug 22 20:24:57 CEST 2012


Author: reimar
Date: Wed Aug 22 20:24:56 2012
New Revision: 35112

Log:
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 -

Modified:
   trunk/stream/stream_file.c

Modified: trunk/stream/stream_file.c
==============================================================================
--- trunk/stream/stream_file.c	Tue Aug 21 10:39:16 2012	(r35111)
+++ trunk/stream/stream_file.c	Wed Aug 22 20:24:56 2012	(r35112)
@@ -56,6 +56,8 @@ static const struct m_struct_st stream_o
 
 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;
 }
 


More information about the MPlayer-cvslog mailing list