[MPlayer-dev-eng] [PATCH] Fix unpause with key_down_event command

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Mar 6 10:56:20 CET 2009


On Thu, Mar 05, 2009 at 10:25:44PM +0100, Adrian Stutz wrote:
> ping.
> 
> It's been almost two months. Any news on this patch?

Well, firstly it is not impossible, adding pausing_keep_force in front
would make it behave as you want already.
Also heaping input logic stuff into mplayer.c is not going to work in
the long term.
It also silently overrides the effects of any pausing, pausing_toggle
etc. prefix, even though those are is unlikely to be useful, that kind
of inconsistency is not helpful.
How would attached patch work for you?

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: mplayer.c
===================================================================
--- mplayer.c	(revision 28806)
+++ mplayer.c	(working copy)
@@ -2346,8 +2346,7 @@
     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);
Index: input/input.c
===================================================================
--- input/input.c	(revision 28806)
+++ input/input.c	(working copy)
@@ -767,7 +767,7 @@
 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 @@
   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;
Index: DOCS/tech/slave.txt
===================================================================
--- DOCS/tech/slave.txt	(revision 28806)
+++ DOCS/tech/slave.txt	(working copy)
@@ -30,6 +30,8 @@
 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):


More information about the MPlayer-dev-eng mailing list