[MPlayer-users] Use of -slave option in latest CVS

Tom Bednarchuk tom.bednarchuk at sympatico.ca
Sun Feb 24 01:21:02 CET 2002


> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Hi Tom Bednarchuk,
>
> on Sat, 23 Feb 2002 17:11:51 -0500 you wrote:
>
> > [Automatic answer: RTFM (read DOCS, FAQ), also read
DOCS/bugreports.html]
> > Hi Alban,
> > > Hi Tom Bednarchuk,
> > >
> > > on Sat, 23 Feb 2002 00:18:19 -0500 you wrote:
> > >
> > > > [Automatic answer: RTFM (read DOCS, FAQ), also read
> > DOCS/bugreports.html]
> > > > Hi again Alban:
> > > >
> > > > I tried the following PERL with MPlayer and only the quit command
> > worked.
> > > > Can you take a look?
> > > >
> > > > #!/usr/bin/perl -w
> > > > print "Hello there !"
> > > >
> > > > open(MPPIPE, "|mplayer -slave -vo x11 /mnt/cdrom/bootyl~2.mpg");
> > > > sleep 40;
> > > > print MPPIPE "stop\n";
> > > > sleep 10;
> > > > print MPPIPE "play\n";
> > > > sleep 40;
> > > > print MPPIPE "quit\n";
> > > >
> > > > The video plays for the 90 or so seconds taken up by the sleep()
total
> > but
> > > > the stop doesn't seem to work. I put in some printf 's in mplayer.c
> > where
> > > > the command is parsed and after the video stops, the printf 's show
up
> > on
> > > > the console but mpayer seems not to care.
> > > Neither stop or play are part of the actual command list.
> > > But you can try to use this in place : stop = "seek 0\npause\n" and
play =
> > "pause\n".
> > > It shoud do the job, except it will not close the window.
> > > Albeu
> > I don't quite understand. In mplayer.c , (search for /* slave mode */)
there
> > are lines to the effect
> >
> > if (!strcmp("play\n", buffer)) {
> >     osd_function=OSD_PLAY;
> > }   else if (!strcmp("stop\n, buffer)) {
> >     osd_function=OSD_PAUSE;
> > } ......................
> >
> > So I don't understand how "seek 0\npause\n" will work since they aren't
> > valid parse lines. Or have I missed something, again ?
> Yes, there is two version. With new-input and wihout. The code you pointed
out is
> the old one. With new-input the command parsing is done in input/input.c
> wich translate them in mp_cmd_t struct. Then mplayer.c read the mp_cmd_t
> using mp_input_get_cmd and perform the action. Note that now new-input is
> the default, and there is no play and stop cmd in new-input. If you want
you
> can use the old code (reconfigure with --disable-new-input), but there is
> not many command.
>
> > If I put printf's in the above, they are output but only after the video
> > stops. "quit\n" is the only command that I can get to work, probably
because
> > it calls exit_player() directly. I'm not quite sure how the osd_function
is
> > supposed to work, any hints would be appreciated.
> This is the job of mplayer. If you just want to deal with the salve mode.
Look into
> input/input.c all know commands are there (quit is one of them). Just send
them
> separated with \n in your pipe. You can send more than one cmd at once,
it's why
> I proposed to use the sequence "seek 0\npause\n" to replace stop.
> Albeu
>
> PS: You use lastest CVS, rigth ?
 Yes, MPlayer CVS-020221-00:00-3.0.2
In fact, I was doing some testing with the 0.60 version and it works better
than the latest CVS. (0.60 will at least do the quit function) Is there a
compiler/config option that I should be using ??? It seems that I must be
doing something wrong.

Thanks again

Tom

P.S. If you can give me a brief overview as to how it is 'supposed to' work,
from a code point of view, maybe I can do some debugging at this end.






More information about the MPlayer-users mailing list