diff -Naur MPlayer-1.0pre2.orig/cfg-mplayer.h MPlayer-1.0pre2/cfg-mplayer.h --- MPlayer-1.0pre2.orig/cfg-mplayer.h 2003-11-30 23:24:17.000000000 +0100 +++ MPlayer-1.0pre2/cfg-mplayer.h 2003-12-02 00:04:33.000000000 +0100 @@ -408,6 +408,7 @@ #endif {"slave", &slave_mode, CONF_TYPE_FLAG,CONF_GLOBAL , 0, 1, NULL}, + {"slave-file", &slave_file, CONF_TYPE_STRING_LIST, CONF_GLOBAL, 0, 0, NULL}, {"use-stdin", &use_stdin, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, #define MAIN_CONF diff -Naur MPlayer-1.0pre2.orig/DOCS/en/mplayer.1 MPlayer-1.0pre2/DOCS/en/mplayer.1 --- MPlayer-1.0pre2.orig/DOCS/en/mplayer.1 2003-11-30 23:24:17.000000000 +0100 +++ MPlayer-1.0pre2/DOCS/en/mplayer.1 2003-12-02 00:07:27.000000000 +0100 @@ -532,6 +532,10 @@ Instead of intercepting keyboard events, MPlayer will read simplistic command lines from its stdin. .TP +.B \-slave-file +This option also enable slave mode but the commands are read from a file +instead of stdin. +.TP .B \-softsleep Uses high quality software timers. As precise as the RTC without requiring special privileges. diff -Naur MPlayer-1.0pre2.orig/DOCS/fr/mplayer.1 MPlayer-1.0pre2/DOCS/fr/mplayer.1 --- MPlayer-1.0pre2.orig/DOCS/fr/mplayer.1 2003-11-30 23:24:17.000000000 +0100 +++ MPlayer-1.0pre2/DOCS/fr/mplayer.1 2003-12-02 00:12:04.000000000 +0100 @@ -548,6 +548,10 @@ .B PROTOCOLE DU MODE ESCLAVE explique la syntaxe. .TP +.B \-slave-file +Cette option enclenche aussi le mode esclave mais les commandes sont lues +depuis un fichier plutôt que depuis l'entrée stdin. +.TP .B \-softsleep Utilise des timers logiciels de haute qualité. Aussi précis que le RTC sans nécessiter de privilèges spéciaux, diff -Naur MPlayer-1.0pre2.orig/mplayer.c MPlayer-1.0pre2/mplayer.c --- MPlayer-1.0pre2.orig/mplayer.c 2003-11-30 23:24:17.000000000 +0100 +++ MPlayer-1.0pre2/mplayer.c 2003-12-02 00:04:33.000000000 +0100 @@ -84,6 +84,7 @@ #include "input/input.h" int slave_mode=0; +char **slave_file; int verbose=0; int identify=0; static int quiet=0; @@ -1121,6 +1122,15 @@ #else mp_input_add_key_fd(-1,0,mplayer_get_key,NULL); #endif +if(slave_file) { + char **name = slave_file; + int fd; + do { + fd = open(*name,O_RDONLY|O_NONBLOCK); + if (fd >= 0) + mp_input_add_cmd_fd(fd,1,NULL,NULL); + }while(*++name); +} if(slave_mode) #ifndef __MINGW32__ mp_input_add_cmd_fd(0,1,NULL,NULL);