[MPlayer-dev-eng] [PATCH] input: add an option to set the default pausing mode.

Nicolas George nicolas.george at normalesup.org
Fri May 3 11:23:14 CEST 2013


---
 DOCS/man/en/mplayer.1 |   20 ++++++++++++++++++++
 cfg-mplayer.h         |    1 +
 input/input.c         |    4 +++-
 input/input.h         |    2 ++
 4 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index 524b4dd..6916ba9 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -1246,6 +1246,26 @@ Useless with modern Linux kernels configured for desktop use as they already
 wake up the process with similar accuracy when using normal timed sleep.
 .
 .TP
+.B \-pausing <0\-3> (MPlayer only)
+Specifies the default pausing behaviour of commands, i.e. whether MPlayer
+will continue playback or stay paused after the command has finished.
+See DOCS/tech/slave.txt for further details.
+.PD 0
+.RSs
+.IPs 0
+resume
+.IPs 1
+pause (pausing)
+.IPs 2
+keep the paused / playing status (pausing_keep)
+.IPs 3
+toggle the paused / playing status (pausing_toggle)
+.IPs 4
+pause without frame step (experimental) (pausing_keep_force)
+.RE
+.PD 1
+.
+.TP
 .B \-playing\-msg <string>
 Print out a string before starting playback.
 The following expansions are supported:
diff --git a/cfg-mplayer.h b/cfg-mplayer.h
index 9bf5280..bcd87e7 100644
--- a/cfg-mplayer.h
+++ b/cfg-mplayer.h
@@ -339,6 +339,7 @@ const m_option_t mplayer_opts[]={
     {"mouse-movements", &enable_mouse_movements, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
     {"nomouse-movements", &enable_mouse_movements, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
     {"doubleclick-time", &doubleclick_time, CONF_TYPE_INT, CONF_RANGE, 0, 1000, NULL},
+    {"pausing", &pausing_default, CONF_TYPE_INT, CONF_RANGE, 0, 4, NULL},
 #ifdef CONFIG_TV
     {"tvscan", tvscan_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
 #else
diff --git a/input/input.c b/input/input.c
index 6ec8307..31106d0 100644
--- a/input/input.c
+++ b/input/input.c
@@ -577,6 +577,8 @@ int (*mp_input_key_cb)(int code) = NULL;
 
 int async_quit_request;
 
+int pausing_default = 0;
+
 static mp_input_fd_t key_fds[MP_MAX_KEY_FD];
 static unsigned int num_key_fd = 0;
 static mp_input_fd_t cmd_fds[MP_MAX_CMD_FD];
@@ -836,7 +838,7 @@ mp_input_parse_cmd(char* str) {
       case MP_CMD_SET_MOUSE_POS:
         pausing = 4; break;
       default:
-        pausing = 0; break;
+        pausing = pausing_default; break;
     }
   }
   cmd->pausing = pausing;
diff --git a/input/input.h b/input/input.h
index 18dcdc8..e723618 100644
--- a/input/input.h
+++ b/input/input.h
@@ -334,4 +334,6 @@ mp_input_check_interrupt(int time);
 
 extern int async_quit_request;
 
+extern int pausing_default;
+
 #endif /* MPLAYER_INPUT_H */
-- 
1.7.10.4



More information about the MPlayer-dev-eng mailing list