Mercurial > mplayer.hg
changeset 13991:28a6f0847c58
add "pausing" prefix for MPlayer commands
author | reimar |
---|---|
date | Sat, 20 Nov 2004 10:51:13 +0000 |
parents | 1d971c4b0412 |
children | 702acff80c44 |
files | DOCS/tech/slave.txt input/input.c input/input.h mplayer.c |
diffstat | 4 files changed, 16 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/DOCS/tech/slave.txt Sat Nov 20 10:48:11 2004 +0000 +++ b/DOCS/tech/slave.txt Sat Nov 20 10:51:13 2004 +0000 @@ -231,3 +231,8 @@ 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. +
--- a/input/input.c Sat Nov 20 10:48:11 2004 +0000 +++ b/input/input.c Sat Nov 20 10:51:13 2004 +0000 @@ -542,6 +542,7 @@ 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 @@ 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 @@ 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;
--- a/input/input.h Sat Nov 20 10:48:11 2004 +0000 +++ b/input/input.h Sat Nov 20 10:51:13 2004 +0000 @@ -139,6 +139,7 @@ char* name; int nargs; mp_cmd_arg_t args[MP_CMD_MAX_ARGS]; + int pausing; } mp_cmd_t;
--- a/mplayer.c Sat Nov 20 10:48:11 2004 +0000 +++ b/mplayer.c Sat Nov 20 10:51:13 2004 +0000 @@ -2749,7 +2749,7 @@ } 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 @@ mp_msg(MSGT_CPLAYER, MSGL_V, "Received unknown cmd %s\n",cmd->name); } } + if (cmd->pausing) + osd_function = OSD_PAUSE; mp_cmd_free(cmd); } }