[MPlayer-users] Calling from execl() in slave mode

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Fri Feb 1 21:15:33 CET 2008

On Fri, Feb 01, 2008 at 01:42:33PM -0600, Javier Castle II wrote:
> Hello everyone, don't now if I just don't have enough experience or am missing something trivial here. I am trying to call mplayer from a program in C and I am using the code execlp("mplayer","-slave",NULL); to call mplayer in the slave mode. It  exits showing command list with no file to play. I thought that it would stay open waiting command. It does play when I pass a file to play. But when the file is done, it also exits. Am I passing the parameter incorrectly? or is it something else? Any insight or links to more documentation would be helpful. Thanks.

You obviously missed the following part of man execl:
"The first argument, by convention,  should point  to the filename
associated with the file being executed."
So you are not passing any arguments at all to MPlayer, you are only
telling it that its binary is name "-slave" (liar! ;-) ).
And I think you will also want -idle in addition to -slave.
And please use proper line breaks in future emails.

Reimar Döffinger

More information about the MPlayer-users mailing list