[MPlayer-dev-eng] patch: Make stdout unbuffered in slave mode

Conrad Wood mplayer at conradwood.net
Tue Oct 8 15:30:46 CEST 2013


attached Patch sets the standard output to non-buffered, if mplayer is
in 'slave' mode.

This has the benefit that a reader connected to mplayer via pipe is a
lot more responsive (feels faster for the user) since the mplayer output
is passed into the pipe (and thus the UI) immediately.

I assumed that this is the case almost always when mplayer is invoked
with '-slave' mode.

The Patch adds these lines to mplayers main() function:


 if (slave_mode) {
    if ( setvbuf(stdout,NULL,_IONBF,0) ==0) {
     printf("Buffering disabled.\n");
    } else {
     printf("Attempt to disable buffering failed: %s
\n",strerror(errno));
      }
  }

I consider it safe on linux systems, but not sure about
windows/mac/other systems. 

I would appreciate if it is applied to current svn as it would make my
usecase much, much better ;)

Thank you,

Conrad



-------------- next part --------------
A non-text attachment was scrubbed...
Name: stdout.patch
Type: text/x-patch
Size: 525 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20131008/017459d3/attachment.bin>


More information about the MPlayer-dev-eng mailing list