[MPlayer-users] Can't get most commands to work in slave mode

Chuck Stein webcoyote at yahoo.com
Thu Aug 28 19:28:13 CEST 2008


Greetings,
I am attempting to use mplayer from a C++ application.  I start it up in slave mode but I cannot get 'pause', 'stop', 'vo_fullscreen', or 'seek' to work.  I do have communication, as 'vo_ontop', and 'speed' do work.  I am using mplayer from the MPlayer-1.0rc2 download.  Here is my code:

    char cmd[250];
    sprintf(cmd, "C:\\dev\\MPlayer-1.0rc2\\mplayer -noborder -vo directx -slave -geometry 600:350 %s", movie_path);
    if((mplayerPipe = popen(cmd, "w")) == NULL)
        PostUserMessage("ERROR: failed to run command: %s\n", cmd);
...
...
            fputs("quit\n", mplayerPipe);  // does not work
            fflush(mplayerPipe); 
            fputs("stop\n", mplayerPipe);  // does not work
            fflush(mplayerPipe); 
            fputs("pause\n", mplayerPipe);  // does not work
            fflush(mplayerPipe); 
            fputs("vo_fullscreen\n", mplayerPipe);   // does not work
            fflush(mplayerPipe); 
            fputs("vo_ontop 1\n", mplayerPipe);   // works!
            fflush(mplayerPipe); 

I am testing this by stepping through the code.  Also, The documentation says the player does not take keyboard commands in slave mode, but I notice that it does.

Thanks much



      


More information about the MPlayer-users mailing list