Sophie

Sophie

distrib > Arklinux > devel > i586 > by-pkgid > 9482443bfa78fcd0975e9204e634806b > files > 15

mplayer-1.0-0.svn34182.1ark.src.rpm

--- mplayer/cfg-mplayer.h.cfifo~	2008-12-04 11:55:39.000000000 +0000
+++ mplayer/cfg-mplayer.h	2008-12-04 12:02:08.917813124 +0000
@@ -9,6 +9,7 @@
 
 extern int key_fifo_size;
 extern unsigned doubleclick_time;
+extern char *cmd_fifo;
 
 extern char *fb_mode_cfgfile;
 extern char *fb_mode_name;
@@ -364,6 +365,7 @@ const m_option_t mplayer_opts[]={
 	{"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
 
 	{"vd", vd_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+	{"cfifo", &cmd_fifo, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},
 	{NULL, NULL, 0, 0, 0, 0, NULL}
 };
 
--- mplayer/mplayer.c.cfifo~	2008-12-04 12:02:08.612931452 +0000
+++ mplayer/mplayer.c	2008-12-04 12:02:31.537816644 +0000
@@ -87,6 +87,8 @@ int player_idle_mode=0;
 int quiet=0;
 int enable_mouse_movements=0;
 float start_volume = -1;
+char *cmd_fifo=NULL;
+int cmd_fifo_fd=-1;
 
 #if defined(__MINGW32__) || defined(__CYGWIN__)
 char * proc_priority=NULL;
@@ -728,6 +730,8 @@ void exit_player_with_rc(exit_reason_t h
   if(mpctx->playtree)
     play_tree_free(mpctx->playtree, 1);
 
+  if(cmd_fifo_fd>0)
+    close(cmd_fifo_fd);
 
   if(edl_records != NULL) free(edl_records); // free mem allocated for EDL
   switch(how) {
@@ -2896,10 +2900,14 @@ if(!codecs_file || !parse_codec_cfg(code
 current_module = "init_input";
 mp_input_init(use_gui);
   mp_input_add_key_fd(-1,0,mplayer_get_key,NULL);
+  if(cmd_fifo)
+    cmd_fifo_fd = open(cmd_fifo, 0, O_RDONLY|O_NONBLOCK);
+  if(cmd_fifo_fd < 0)
+    cmd_fifo_fd = 0;
 if(slave_mode)
-  mp_input_add_cmd_fd(0,USE_SELECT,MP_INPUT_SLAVE_CMD_FUNC,NULL);
+  mp_input_add_cmd_fd(cmd_fifo,USE_SELECT,MP_INPUT_SLAVE_CMD_FUNC,NULL);
 else if(!noconsolecontrols)
-    mp_input_add_event_fd(0, getch2);
+    mp_input_add_event_fd(cmd_fifo, getch2);
 // Set the libstream interrupt callback
 stream_set_interrupt_callback(mp_input_check_interrupt);