[MPlayer-cvslog] r28870 - in trunk: DOCS/tech/slave.txt input/input.c mplayer.c

reimar subversion at mplayerhq.hu
Sat Mar 7 14:25:56 CET 2009


Author: reimar
Date: Sat Mar  7 14:25:55 2009
New Revision: 28870

Log:
Make pausing_keep_force the default for the set_mouse_pos and key_down_event -
different behaviour is unlikely to make sense but it is better to handle
this in input.c instead of adding special cases to mplayer.c and being
able to override the default behaviour at least should not hurt.

Modified:
   trunk/DOCS/tech/slave.txt
   trunk/input/input.c
   trunk/mplayer.c

Modified: trunk/DOCS/tech/slave.txt
==============================================================================
--- trunk/DOCS/tech/slave.txt	Sat Mar  7 13:50:52 2009	(r28869)
+++ trunk/DOCS/tech/slave.txt	Sat Mar  7 14:25:55 2009	(r28870)
@@ -30,6 +30,8 @@ As a temporary hack, there is also the _
 prefix, with which MPlayer will not exit the pause loop at all.
 Like this you can avoid the "frame stepping" effect of "pausing_keep "
 but most commands will either not work at all or behave in unexpected ways.
+For "set_mouse_pos" and "key_down_event", "pausing_keep_force" is the default
+since other values do not make much sense for them.
 
 
 Available commands ('mplayer -input cmdlist' will print a list):

Modified: trunk/input/input.c
==============================================================================
--- trunk/input/input.c	Sat Mar  7 13:50:52 2009	(r28869)
+++ trunk/input/input.c	Sat Mar  7 14:25:55 2009	(r28870)
@@ -767,7 +767,7 @@ int mp_input_parse_and_queue_cmds(const 
 mp_cmd_t*
 mp_input_parse_cmd(char* str) {
   int i,l;
-  int pausing = 0;
+  int pausing = -1;
   char *ptr,*e;
   mp_cmd_t *cmd;
   const mp_cmd_t *cmd_def;
@@ -817,6 +817,15 @@ mp_input_parse_cmd(char* str) {
   cmd = calloc(1, sizeof(mp_cmd_t));
   cmd->id = cmd_def->id;
   cmd->name = strdup(cmd_def->name);
+  if (pausing == -1) {
+    switch (cmd->id) {
+      case MP_CMD_KEYDOWN_EVENTS:
+      case MP_CMD_SET_MOUSE_POS:
+        pausing = 4; break;
+      default:
+        pausing = 0; break;
+    }
+  }
   cmd->pausing = pausing;
 
   ptr = str;

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Sat Mar  7 13:50:52 2009	(r28869)
+++ trunk/mplayer.c	Sat Mar  7 14:25:55 2009	(r28870)
@@ -2346,8 +2346,7 @@ static void pause_loop(void)
     if (mpctx->audio_out && mpctx->sh_audio)
 	mpctx->audio_out->pause();	// pause audio, keep data if possible
 
-    while ( (cmd = mp_input_get_cmd(20, 1, 1)) == NULL
-            || cmd->id == MP_CMD_SET_MOUSE_POS || cmd->pausing == 4) {
+    while ( (cmd = mp_input_get_cmd(20, 1, 1)) == NULL || cmd->pausing == 4) {
 	if (cmd) {
 	  cmd = mp_input_get_cmd(0,1,0);
 	  run_command(mpctx, cmd);



More information about the MPlayer-cvslog mailing list