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

jacopo mondi j.mondi at voltaelectronics.com
Sat Dec 3 11:22:02 CET 2011


On 12/03/2011 08:42 AM, Reimar Döffinger wrote:
> On Fri, Dec 02, 2011 at 10:52:29AM +0100, jacopo mondi wrote:
>> On 12/01/2011 07:55 PM, Reimar Döffinger wrote:
>>> 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.
>> I send the quit command, then I terminate the PID (just in case it's
>> still alive)
> And how long do you wait in-between?
Not enough.. It's not even needed to kill the thread... Just send quit 
command and wait until mplayer dies on his own...
>>> 2) Tools like ps can figure out all child processes, so I am
>>>     sure there's some way you could, too.
>> I know, but the plugin is supposed to run without external intervention
> So? I meant you obviously can just copy-past the code ps/pstree uses to
> find child processes.
> But this is not reliable anyway.
If possible, I always try to avoid using system().
>>> 3) I have a patch (see mplayer-dev-eng) that makes it quite if
>>>     the parent disappeared and I'll apply it shortly.
>> If it's possible we prefer to use mplayer version already present in
>> our distribution's repositories...
> Then get the distributions to update and/or apply that patch.

Thank you for your interest..
     j
> _______________________________________________
> MPlayer-users mailing list
> MPlayer-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users



More information about the MPlayer-users mailing list