[MPlayer-dev-eng] Re: Slave mode and pipes

D Richard Felker III dalias at aerifal.cx
Wed May 22 14:43:27 CEST 2002


On Wed, May 22, 2002 at 07:52:31AM +0200, Alexander Neundorf wrote:
> On Wednesday 22 May 2002 03:53, you wrote:
> > On Tue, 21 May 2002, murban wrote:
> > > The program does start mplayer, but it is not able to get mplayer to
> > > respond to commands.
> >
> > Output to a pipe is block buffered, so you need to fflush(stream)
> > after the fprintf.
> >
> > Alternatively, you can set the buffering mode of stream to "line
> > buffered" using setvbuf(stream, NULL, _IOLBF, 0) before you start
> > printing.
> >
> > Eric
> 
> Well, that's why I sent the patch to the mailing list which does this call in 
> mplayer main() when readig from stdin (but you all convinced my that it can't 
> have the effect it has apparently on my system :-P)

NO! That is entirely unrelated. Buffering is part of libc, not a
property of the pipe itself. Setting line buffering on the stdout
FILE* of the master program has nothing whatsoever to do with setting
it on the stdin FILE* of mplayer. It is a property of the libc FILE
structure, which is local to the program. Quit this nonsense. It shows
a complete misunderstanding of C and POSIX files semantics.

Rich




More information about the MPlayer-dev-eng mailing list