Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: MP3 Plugin



Michael Dreher wrote:
> Hi!
> 
>  > > BTW: Do you have any idea, why Mplayer doesn't exit cleanly
>  > > after ending replay (in slave mode) via any of the "quit replay"
>  > > buttons or if the movie is over? I always have to manually kill
>  >
>  > No idea, but I'm not using mplayer regularly and have still pre8
>  > installed.
> 
> I had the same problem and I also have a fix. It consists of two parts:
> 1. The mplayer.sh script has to be changed. Just remove the "exec" in the
> line
> where mplayer is started. This may stop the non-slave mode to work, but
> works
> great in slave mode with patched mplayer plugin.

Michael,

your patch doesn't really fix the problem. It just "avoids" it.

I have a theory, but I'm not sure, as I didn't read the full source:

In player-mplayer.c we have in cMPlayerPlayer::Activate()

...
    kill(pid,SIGTERM);
    waitpid(pid,0,0); // get status otherwise the child stays as a zomb.
    ClosePipe();
...

So we kill mplayer, wait for the PID to disappear and _then_ close the
pipe(s). I suspect the mplayer process to hang until (especially) the
input pipe (mplayer-wise seen) is closed. So the process will never exit
until the pipes are closed (or the video ends).

So we will have to close the pipes before we wait for mplayer to exit.

Would be nice if some people could test this in SLAVE mode.
There are no changes to mplayer.sh necessary, just apply the attached
patch to the mplayer-plugin. It seems to work, but it had no extended
testing ;).

Cheers,
Juri


-- Attached file included as plaintext by Listar --
-- File: vdr-mp3-0.7.10-slave.patch

diff -purN mp3-0.7.10/player-mplayer.c mp3/player-mplayer.c
--- mp3-0.7.10/player-mplayer.c	2002-09-06 18:39:36.000000000 +0200
+++ mp3/player-mplayer.c	2003-03-05 02:38:28.000000000 +0100
@@ -125,9 +125,9 @@ void cMPlayerPlayer::Activate(bool On)
   else if(started) {
     run=false;
     kill(pid,SIGTERM);
+    ClosePipe();
     waitpid(pid,0,0); // get status otherwise the child stays as a zombie forever
     started=slave=false;
-    ClosePipe();
     Cancel(2);
     }
 }



-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index