mirror of
https://github.com/mpv-player/mpv
synced 2025-02-11 15:24:30 +01:00
add "pausing_keep" and "pausing_toggle" input cmd prefixes
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17242 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
95db0aeb23
commit
3c3d7c2039
@ -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):
|
||||
|
@ -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++)
|
||||
|
15
mplayer.c
15
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;
|
||||
|
Loading…
Reference in New Issue
Block a user