Mailing List archive

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

[vdr] Re: MP3 Plugin



On 05 Mar 2003 Juri Haberland <juri@koschikode.com> wrote:

> 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).

Nice theory :-)
May be, not the input pipe is the problem, but the output pipe.
Mplayer tends to output a lot (even more if started without
-quiet) on stdout/stderr. Pipes only have a small buffer (usualy
4k). First statement to stop is "run=false" which stops
processing of pipe data. If the pipe-buffer runs full after this
(e.g. from MPlayers exit messages) any following output of
mplayer will block.

Please try out the following stop sequence:

  kill(pid,SIGTERM);
  waitpid(pid,0,0); // get status otherwise the child stays as a zombie forever
  run=false;
  ClosePipe();
  Cancel(2);

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

Yes, this would prevent Mplayer blocking too, as every acces would
result in a "broken pipe" error.

Please report your test results.

CU.

-- 
Stefan Huelswitt
huels@iname.com  | http://home.pages.de/~nathan


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



Home | Main Index | Thread Index