summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-11-20 10:51:13 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-11-20 10:51:13 +0000
commit987c740e5f8caa41b157d2facc1cf17df9724b96 (patch)
tree7b67e23e5265c2e353f281da00fc933476fc81e8
parent2a56407e378b5dd6897bc108d9a39309c9614356 (diff)
downloadmpv-987c740e5f8caa41b157d2facc1cf17df9724b96.tar.bz2
mpv-987c740e5f8caa41b157d2facc1cf17df9724b96.tar.xz
add "pausing" prefix for MPlayer commands
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13992 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--DOCS/tech/slave.txt5
-rw-r--r--input/input.c7
-rw-r--r--input/input.h1
-rw-r--r--mplayer.c4
4 files changed, 16 insertions, 1 deletions
diff --git a/DOCS/tech/slave.txt b/DOCS/tech/slave.txt
index 88444205d1..8dd0301fe2 100644
--- a/DOCS/tech/slave.txt
+++ b/DOCS/tech/slave.txt
@@ -231,3 +231,8 @@ hide
run <value>
???
+
+All commands can be prefixed with "pausing ", causing MPlayer to get into
+paused mode as soon as possible after processing the command.
+Please note that this can be before the command is fully executed.
+
diff --git a/input/input.c b/input/input.c
index 2b2fe5007c..ef9a6e04bd 100644
--- a/input/input.c
+++ b/input/input.c
@@ -542,6 +542,7 @@ mp_input_add_key_fd(int fd, int select, mp_key_func_t read_func, mp_close_func_t
mp_cmd_t*
mp_input_parse_cmd(char* str) {
int i,l;
+ int pausing = 0;
char *ptr,*e;
mp_cmd_t *cmd, *cmd_def;
@@ -549,6 +550,11 @@ mp_input_parse_cmd(char* str) {
assert(str != NULL);
#endif
+ if (strncmp(str, "pausing ", 8) == 0) {
+ pausing = 1;
+ str = &str[8];
+ }
+
for(ptr = str ; ptr[0] != '\0' && ptr[0] != '\t' && ptr[0] != ' ' ; ptr++)
/* NOTHING */;
if(ptr[0] != '\0')
@@ -572,6 +578,7 @@ mp_input_parse_cmd(char* str) {
cmd = (mp_cmd_t*)malloc(sizeof(mp_cmd_t));
cmd->id = cmd_def->id;
cmd->name = strdup(cmd_def->name);
+ cmd->pausing = pausing;
ptr = str;
diff --git a/input/input.h b/input/input.h
index ce65879a31..f748843e80 100644
--- a/input/input.h
+++ b/input/input.h
@@ -139,6 +139,7 @@ typedef struct mp_cmd {
char* name;
int nargs;
mp_cmd_arg_t args[MP_CMD_MAX_ARGS];
+ int pausing;
} mp_cmd_t;
diff --git a/mplayer.c b/mplayer.c
index 872e0f05d2..e7f5fc7d55 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -2749,7 +2749,7 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still)
} break;
case MP_CMD_FRAME_STEP :
case MP_CMD_PAUSE : {
- osd_function=OSD_PAUSE;
+ cmd->pausing = 1;
brk_cmd = 1;
} break;
case MP_CMD_QUIT : {
@@ -3664,6 +3664,8 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still)
mp_msg(MSGT_CPLAYER, MSGL_V, "Received unknown cmd %s\n",cmd->name);
}
}
+ if (cmd->pausing)
+ osd_function = OSD_PAUSE;
mp_cmd_free(cmd);
}
}