1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 00:42:57 +00:00

Add a slave command to stop stream playback.

Mostly useful when used with -idle mode.
Patch by Mathieu Schroeter ( mathieu dot schroeter at gamesover dot ch )



git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26909 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
ben 2008-05-27 18:39:57 +00:00
parent cc6c63c03c
commit bc212e3500
8 changed files with 19 additions and 0 deletions

View File

@ -232,6 +232,8 @@ Pressing once will pause movie, every consecutive press will play one frame
and then go into pause mode again (any other key unpauses). and then go into pause mode again (any other key unpauses).
.IPs "q / ESC" .IPs "q / ESC"
Stop playing and quit. Stop playing and quit.
.IPs "U\ \ \ \ "
Stop playing (and quit if \-idle is not used).
.IPs "+ and \-" .IPs "+ and \-"
Adjust audio delay by +/\- 0.1 seconds. Adjust audio delay by +/\- 0.1 seconds.
.IPs "/ and *" .IPs "/ and *"

View File

@ -246,6 +246,8 @@ juste une trame et remettra le film en pause (toute autre touche arr
pause). pause).
.IPs "q / ESC" .IPs "q / ESC"
Stoppe la lecture et quitte. Stoppe la lecture et quitte.
.IPs "U\ \ \ \ "
Stoppe la lecture (et quitte si \-idle n'est pas utilisé).
.IPs "+ et \-" .IPs "+ et \-"
Ajuste le décalage audio de +/\- 0.1 secondes. Ajuste le décalage audio de +/\- 0.1 secondes.
.IPs "/ et *" .IPs "/ et *"

View File

@ -267,6 +267,9 @@ step_property <property> [value] [direction]
not given or zero. The direction is reversed if direction is less not given or zero. The direction is reversed if direction is less
than zero. than zero.
stop
Stop playback.
sub_alignment [value] sub_alignment [value]
Toggle/set subtitle alignment. Toggle/set subtitle alignment.
0 top alignment 0 top alignment

View File

@ -2621,6 +2621,11 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
} }
break; break;
case MP_CMD_STOP:
mpctx->eof = PT_STOP;
brk_cmd = 1;
break;
#ifdef USE_RADIO #ifdef USE_RADIO
case MP_CMD_RADIO_STEP_CHANNEL: case MP_CMD_RADIO_STEP_CHANNEL:
if (mpctx->demuxer->stream->type == STREAMTYPE_RADIO) { if (mpctx->demuxer->stream->type == STREAMTYPE_RADIO) {

View File

@ -64,6 +64,7 @@ static const mp_cmd_t mp_cmds[] = {
{ MP_CMD_SPEED_MULT, "speed_mult", 1, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } }, { MP_CMD_SPEED_MULT, "speed_mult", 1, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } },
{ MP_CMD_SPEED_SET, "speed_set", 1, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } }, { MP_CMD_SPEED_SET, "speed_set", 1, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } },
{ MP_CMD_QUIT, "quit", 0, { {MP_CMD_ARG_INT,{0}}, {-1,{0}} } }, { MP_CMD_QUIT, "quit", 0, { {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
{ MP_CMD_STOP, "stop", 0, { {-1,{0}} } },
{ MP_CMD_PAUSE, "pause", 0, { {-1,{0}} } }, { MP_CMD_PAUSE, "pause", 0, { {-1,{0}} } },
{ MP_CMD_FRAME_STEP, "frame_step", 0, { {-1,{0}} } }, { MP_CMD_FRAME_STEP, "frame_step", 0, { {-1,{0}} } },
{ MP_CMD_PLAY_TREE_STEP, "pt_step",1, { { MP_CMD_ARG_INT ,{0}}, { MP_CMD_ARG_INT ,{0}}, {-1,{0}} } }, { MP_CMD_PLAY_TREE_STEP, "pt_step",1, { { MP_CMD_ARG_INT ,{0}}, { MP_CMD_ARG_INT ,{0}}, {-1,{0}} } },
@ -473,6 +474,7 @@ static const mp_cmd_bind_t def_cmd_binds[] = {
{ { '!', 0 }, "seek_chapter -1" }, { { '!', 0 }, "seek_chapter -1" },
{ { '@', 0 }, "seek_chapter 1" }, { { '@', 0 }, "seek_chapter 1" },
{ { 'A', 0 }, "switch_angle 1" }, { { 'A', 0 }, "switch_angle 1" },
{ { 'U', 0 }, "stop" },
{ { 0 }, NULL } { { 0 }, NULL }
}; };

View File

@ -109,6 +109,7 @@
#define MP_CMD_SWITCH_ANGLE 105 #define MP_CMD_SWITCH_ANGLE 105
#define MP_CMD_ASS_USE_MARGINS 106 #define MP_CMD_ASS_USE_MARGINS 106
#define MP_CMD_SWITCH_TITLE 107 #define MP_CMD_SWITCH_TITLE 107
#define MP_CMD_STOP 108
#define MP_CMD_GUI_EVENTS 5000 #define MP_CMD_GUI_EVENTS 5000
#define MP_CMD_GUI_LOADFILE 5001 #define MP_CMD_GUI_LOADFILE 5001

View File

@ -39,6 +39,7 @@
#define PT_PREV_SRC -2 #define PT_PREV_SRC -2
#define PT_UP_NEXT 3 #define PT_UP_NEXT 3
#define PT_UP_PREV -3 #define PT_UP_PREV -3
#define PT_STOP 4
typedef struct MPContext { typedef struct MPContext {

View File

@ -3998,6 +3998,9 @@ if(mpctx->eof == PT_NEXT_ENTRY || mpctx->eof == PT_PREV_ENTRY) {
mpctx->playtree_iter = NULL; mpctx->playtree_iter = NULL;
} }
} }
} else if (mpctx->eof == PT_STOP) {
play_tree_iter_free(mpctx->playtree_iter);
mpctx->playtree_iter = NULL;
} else { // NEXT PREV SRC } else { // NEXT PREV SRC
mpctx->eof = mpctx->eof == PT_PREV_SRC ? -1 : 1; mpctx->eof = mpctx->eof == PT_PREV_SRC ? -1 : 1;
} }