[MPlayer-dev-eng] [PATCH] watchpid slave command

Nicolas George nicolas.george at normalesup.org
Wed Aug 12 18:39:02 CEST 2009


Le quintidi 25 thermidor, an CCXVII, rototor at rototor.de a écrit :
> attached you find a patch which adds a new slave command "watchpid". The
> command has the syntax:
> 
> watchpid <process-id>
> 
> When mplayer gets this command it will in future watch if the process
> specified by the PID is still alive. If the watched process is no longer
> alive mplayer will quit.
> 
> This patch is useful if you build your own mplayer frontend and want
> mplayer to exit if your frontend crashes. In our case we use mplayer in
> our game Hive Rise (http://www.hiverise.com) to play ingame webradio. If
> the game exits unexpectedly mplayer should stop playing. 

The principle seems flawed to me: periodic polling is never a good option,
and watching a PID is not reliable, because PID can be reused.

If your plumbing is done correctly, whenever your frontend crashed, mplayer
should get an EOF condition on the slave fd: the best option is to make
mplayer (optionally) exit on EOF from input fds. After a quick glance at the
input code, I think this would require much less code than your patch.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20090812/45ff7d08/attachment.pgp>


More information about the MPlayer-dev-eng mailing list