[MPlayer-users] how to get the OEF with using mplayer slave ?

Alexandre CONRAD aconrad.tlv at magic.fr
Mon Dec 5 17:13:58 CET 2005


Any suggestion ?

Alexandre CONRAD wrote:

> Hello,
> 
> I'm writing a frontend to mplayer in -slave -idle mode. I would like to 
> know how I can catch when the current playing video reaches the End Of 
> File?
> 
> It seems that a \n "newline" is sent to stdout when the file finished. 
> But it's hard to parse when other messages during playback appear... 
> reading some mpeg2 files shows "Broken frame at 0x42720" at the end with 
> some new lines which doesn't make it easy to catch.
> 
> Right now, I'm sending the "get_percent_pos" every 0.1 seconds and load 
> the next video when "ANS_PERCENT_POSITION=100" returns. But it's not at 
> all accurate on very short videos because you kinda get:
> 
> ANS_PERCENT_POSITION=50
> ANS_PERCENT_POSITION=100
> 
> But sometimes, I don't have time to catch the "100", the video is 
> already finished and unloaded. Which results as blocking my application 
> trying to read the stdout pipe buffer waiting for 
> "ANS_PERCENT_POSITION=100" to come in.
> 
> So I thought about a new syntax that could request mplayer to send back 
> the video's name:
> 
> send > get_loaded
> recv < "foo.mpg"
> 
> And when no video is playling
> send > get_loaded
> recv < "no file is currently loaded"
> 
> I'm not a C programmer so I couldn't do that my self.
> 
> But maybe this is just too much. Has anyone got an clean and accurate 
> way to catch the EOF ? Thanks.
> 
> Best 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