[MPlayer-users] double mplayer instance when playing HTTP streams

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu Dec 1 19:55:10 CET 2011


On Thu, Dec 01, 2011 at 05:36:50PM +0100, jacopo mondi wrote:
> Hi there,
>     I'm using mplayer in slave mode, and controlling it by mean of a
> custom web browser plugin.
> When playing HTTP streams, I always found two mplayer instances
> running. One is launched by myself, the other shows up after the
> 'loadfile' command is issued to mplayer stdin.
> 
> When I have to shutdown the plugin the child remains alive, since I
> only know the father's pid.
> Why does mplayer forks to player HTTP stream? Is there any way to
> terminate both the processes?

Besides the mentioned recommended of using the quit command
1) Killing a process with SIGKILL without even giving it a chance
   to quit properly (e.g. by sending SIGTERM first) is a bad
   idea in all cases.
2) Tools like ps can figure out all child processes, so I am
   sure there's some way you could, too.
3) I have a patch (see mplayer-dev-eng) that makes it quite if
   the parent disappeared and I'll apply it shortly.
4) The only really reliable method is to create a new process
   group for MPlayer and then kill the process group instead
   of just the process.


More information about the MPlayer-users mailing list