[MPlayer-users] Writing a frontend with slave mode

Alexandre CONRAD aconrad.tlv at magic.fr
Thu Dec 22 18:49:59 CET 2005


>>Currently, I would have to launch an mplayer process for every track .
>>How do other frontends accomplish something similar?
> 
> 
> Before -idle, that's what they did, or else they managed the playlist
> via slave command before the current file reached EOF (or, if they knew
> the playlist before mplayer starts, just specified each file as
> arguments).


I'm currently writing a frontend myself and the only way that works out 
pretty well for me is to start mplayer with "-slave -idle -identify". 
When a file is loaded, I catch mplayer's output parsing for the 
ID_LENGHT=XX.X message (from -identify) and give a timeout to my 
frontend. But we keep guessing about mplayer's status. It would be 
better to catch a signal from mplayer telling the frontend that the file 
is finished playing, but that's not implemented right now. The timer 
trick works out pretty well for me actually.
Also, I've only worked with mpeg2 and mpeg4 files. So I don't know if 
ID_LENGHT actually works for all the video formats.

There's been a discussion about how to catch the EOF using the -idle 
command on the mplayer-dev-eng mailing list, about adding some extra 
SLAVE messages for making it easier for frontend writers to know what's 
going on with mplayer. Seach for "slave" in the december's 2005 archive:

http://mplayerhq.hu/pipermail/mplayer-dev-eng/2005-December/thread.html

Apparently, it's been dropped for now. But it would be really great if a 
bunch of extra easealy parsable messages could be added to make frontend 
writer's life easier. :-) Not only informational messages 
(SLAVE_FILE_STARTED=file.mpg, SLAVE_FILE_STOPPED=file.mpg), but also 
error messages and so on (SLAVE_FILE_NOT_FOUND=file.mpg - even if this 
sould be checked by the frontend itself before sending the "loadfile" 
command to mplayer).

Regards,
-- 
Alexandre CONRAD - TLV
Research & Development
tel : +33 1 30 80 55 05
fax : +33 1 30 80 55 06
6, rue de la plaine
78860 - SAINT NOM LA BRETECHE
FRANCE




More information about the MPlayer-users mailing list