[MPlayer-dev-eng] [PATCH] Extra messages in slave mode

Oded Shimon ods15 at ods15.dyndns.org
Mon Dec 5 20:04:56 CET 2005


On Mon, Dec 05, 2005 at 01:05:46PM +0100, Andras Mohari wrote:
> Hi,
> 
> I've seen a message on mplayer-users ("how to get the OEF with using
> mplayer slave ?" by Alexandre CONRAD <aconrad.tlv at magic.fr>) about the
> hardships of detecting when MPlayer stops playing in idle mode.
> I think that all frontends could benefit from MPlayer printing some
> useful, easy to parse and unambiguous messages when something
> interesting happens, not just when you use a get_* slave command or
> something.
> 
> So this patch makes 'mplayer -slave' print some lines starting with
> SLAVE_ to indicate what it is doing. These are:
> 
> * SLAVE_FILE <filename>
>   Printed when MPlayer is about to play a file.
> 
> * SLAVE_PLAYING
>   Printed when MPlayer actually starts playing.
> 
> * SLAVE_PAUSED and SLAVE_UNPAUSED
>   Printed _every time_ MPlayer is paused/unpaused. (Not just in
>   response to the 'pause' command.) So, for example, you'll get this when
>   sending the 'frame_step' command while paused:
> 
>         SLAVE_UNPAUSED
>         SLAVE_PAUSED
> 
> * SLAVE_STOPPED
>   Printed when MPlayer finished playing the current file. (But not when
>   you quit or kill the player.)

I fail to see the usefulness of some of these messages, but anyway, since 
identify has already become the pseudo slave output, wouldn't it be better 
to make all of these with identify instead? (as there already is an 
ID_PAUSED for ex., and ID_FILENAME)

Also, what's the point of SLAVE_PLAYING, it comes right after SLAVE_FILE ? 
is the point to make sure the file started playing successfully? or to wait 
for the lag between loading the file until it actually plays?

> +      if(slave_mode) {
> +        mp_msg(MSGT_GLOBAL,MSGL_INFO, "SLAVE_PAUSED\n");
> +        fflush(stdout);

The fflush is useless, there's one in mp_msg already. the fflush a few 
lines up should be removed.

Also, I definetaly agree with reimar's suggestion for a new MSGT_ for 
identify and slave... If I ever make that patch where you can pick 
verbosity by MSGT, it would work very well...

- ods15




More information about the MPlayer-dev-eng mailing list