summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorods15 <ods15@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-12-25 19:22:48 +0000
committerods15 <ods15@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-12-25 19:22:48 +0000
commit3c3d7c203924daa93aa1a1a57d3bc2b1b7e46161 (patch)
treecd34dfce1b79d95c48788f2ab187ab1219c4b352
parent95db0aeb236eebd0f6c517078bc8df299599a02a (diff)
downloadmpv-3c3d7c203924daa93aa1a1a57d3bc2b1b7e46161.tar.bz2
mpv-3c3d7c203924daa93aa1a1a57d3bc2b1b7e46161.tar.xz
add "pausing_keep" and "pausing_toggle" input cmd prefixes
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17242 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--DOCS/tech/slave.txt9
-rw-r--r--input/input.c6
-rw-r--r--mplayer.c15
3 files changed, 25 insertions, 5 deletions
diff --git a/DOCS/tech/slave.txt b/DOCS/tech/slave.txt
index 3510a24cb5..bedceba4f5 100644
--- a/DOCS/tech/slave.txt
+++ b/DOCS/tech/slave.txt
@@ -15,9 +15,12 @@ Most slave mode commands are equivalent to command line options, though not
necessarily under the same name. Detailed descriptions can be found in the
man page.
-All commands can be prefixed with "pausing ", causing MPlayer to pause as soon
-as possible after processing the command. Please note that this can be before
-the command is fully executed.
+All commands can be prefixed with one of "pausing ", "pausing_keep ", or
+"pausing_toggle ". "pausing " tells MPlayer to pause as soon as possible
+after processing the command. "pausing_keep " tells MPlayer to do so only if
+it was already in paused mode. "pausing_toggle " tells MPlayer to do so
+only if it was not already in paused mode. Please note that "as soon as
+possible" can be before the command is fully executed.
Available commands ('mplayer -input cmdlist' will print a list):
diff --git a/input/input.c b/input/input.c
index f3b354a8c8..13fb14ccc2 100644
--- a/input/input.c
+++ b/input/input.c
@@ -600,6 +600,12 @@ mp_input_parse_cmd(char* str) {
if (strncmp(str, "pausing ", 8) == 0) {
pausing = 1;
str = &str[8];
+ } else if (strncmp(str, "pausing_keep ", 13) == 0) {
+ pausing = 2;
+ str = &str[13];
+ } else if (strncmp(str, "pausing_toggle ", 15) == 0) {
+ pausing = 3;
+ str = &str[15];
}
for(ptr = str ; ptr[0] != '\0' && ptr[0] != '\t' && ptr[0] != ' ' ; ptr++)
diff --git a/mplayer.c b/mplayer.c
index fcf3c085d6..929d326c5b 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -2448,6 +2448,7 @@ unsigned int lastframeout_ts=0;
float next_frame_time=0;
int frame_time_remaining=0; // flag
int blit_frame=0;
+int was_paused=0;
osd_text_buffer[0]=0;
// make sure OSD old does not stay around,
@@ -3047,6 +3048,7 @@ if(auto_quality>0){
guiGetEvent( guiCEvent,(char *)guiSetPlay );
}
#endif
+ was_paused = 1;
}
// handle -sstep
@@ -4129,11 +4131,20 @@ 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;
+ switch (cmd->pausing) {
+ case 1: // "pausing"
+ osd_function = OSD_PAUSE;
+ break;
+ case 3: // "pausing_toggle"
+ was_paused = !was_paused;
+ // fall through
+ case 2: // "pausing_keep"
+ if (was_paused) osd_function = OSD_PAUSE;
+ }
mp_cmd_free(cmd);
}
}
+ was_paused = 0;
if (seek_to_sec) {
int a,b; float d;