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

Aurelien Jacobs aurel at gnuage.org
Tue Sep 14 01:03:25 CEST 2004


On Sat, 11 Sep 2004 19:02:15 +0900
Attila Kinali <attila at kinali.ch> 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.

I do not really agree about what you call a normal behavior.
I don't expect that running a command will "pause" the video
during the execution of this command.

Anyway, starting an external process will have to call fork, even if
it is hidden in a system().

And finally, I've done it like this because it's the way it done in
libmenu/menu_console.c

Aurel




More information about the MPlayer-dev-eng mailing list