[MPlayer-dev-eng] [PATCH] run command from osd menu

D Richard Felker III dalias at aerifal.cx
Tue Sep 14 02:24:57 CEST 2004


On Mon, Sep 13, 2004 at 11:14:20AM -0500, Joey Parrish wrote:
> On Sat, Sep 11, 2004 at 07:02:15PM +0900, Attila Kinali wrote:
> > On Fri, Sep 03, 2004 at 03:01:17AM +0200, Aurelien Jacobs wrote:
> > > On Thu, 2 Sep 2004 08:59:38 -0500
> > > Joey Parrish <joey at nicewarrior.org> wrote:
> > > 
> > > > On Thu, Sep 02, 2004 at 03:27:19PM +0000, Sascha Sommer wrote:
> > > > > On Friday 27 August 2004 11:37, Aurelien Jacobs wrote:
> > > > > > This patch allows to use the run command (from the osd menu
> > > > > > console) also from the menu config file, so that a menu entry
> > > > > > can call an external program.
> > > diff -Naur MPlayer-1.0pre5.orig/mplayer.c MPlayer-1.0pre5/mplayer.c
> > > --- MPlayer-1.0pre5.orig/mplayer.c	2004-09-01 17:15:36.000000000 +0200
> > > +++ MPlayer-1.0pre5/mplayer.c	2004-09-03 02:54:26.925388456 +0200
> > > @@ -3151,6 +3151,15 @@
> > >  	mp_msg(MSGT_GLOBAL,MSGL_INFO,"ANS_PERCENT_POSITION=%ld\n", demuxer_get_percent_pos(demuxer));
> > >      } break;
> > >  
> > > +#if defined(HAVE_MENU) && !defined(__MINGW32__)
> > > +    case MP_CMD_CRUN : {
> > > +        if(!fork()) {
> > 
> > Why fork() ?
> > For me the "normal" behavior of executing an shell comand from a program
> > is, that it runs exec and blocks until the command finishes.
> 
> IIRC, only when using system().  exec() does not block.
> I believe that system uses fork, exec, and wait.
> Also, it may be that not all machines have system().

wtf?!?!? system() is even more reliable than fork/exec! it's full ansi c!

rich




More information about the MPlayer-dev-eng mailing list