[MPlayer-users] slave mode

D Richard Felker III dalias at aerifal.cx
Thu Feb 19 17:24:12 CET 2004


On Thu, Feb 19, 2004 at 04:09:52PM +0100, Joris Van Puyenbroeck wrote:
> Hello,
> 
> I'm using a simple bash script to interrupt (pause) video play at fixed
> intervals (10 seconds), and wait for random key input (read) to continue
> (second pause).
> 
> #!/bin/bash
> (while true; do echo pause; read; echo pause; sleep 10; done) | mplayer
> -slave -osdlevel 2 test.wmv
> 
> But after the first pause, video play continues no matter what.
> What am I doing wrong here?
> I read the documentation on slave mode protocol thoroughly, but I can't
> figure out my mistake.

The shell script's output isn't line buffered since it's over pipe. So
the data doesn't get sent until the buffers are full. Write a program
in C to send the commands after turning on line buffering (or turning
off buffering completely) on stdout.

Rich




More information about the MPlayer-users mailing list