[MPlayer-cvslog] r26909 - in trunk: DOCS/man/en/mplayer.1 DOCS/man/fr/mplayer.1 DOCS/tech/slave.txt command.c input/input.c input/input.h mp_core.h mplayer.c

ben subversion at mplayerhq.hu
Tue May 27 20:39:57 CEST 2008


Author: ben
Date: Tue May 27 20:39:57 2008
New Revision: 26909

Log:
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 )



Modified:
   trunk/DOCS/tech/slave.txt
   trunk/command.c
   trunk/input/input.c
   trunk/input/input.h
   trunk/mp_core.h
   trunk/mplayer.c

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/man/en/mplayer.1
   trunk/DOCS/man/fr/mplayer.1

Modified: trunk/DOCS/tech/slave.txt
==============================================================================
--- trunk/DOCS/tech/slave.txt	(original)
+++ trunk/DOCS/tech/slave.txt	Tue May 27 20:39:57 2008
@@ -267,6 +267,9 @@ step_property <property> [value] [direct
     not given or zero. The direction is reversed if direction is less
     than zero.
 
+stop
+    Stop playback.
+
 sub_alignment [value]
     Toggle/set subtitle alignment.
         0 top alignment

Modified: trunk/command.c
==============================================================================
--- trunk/command.c	(original)
+++ trunk/command.c	Tue May 27 20:39:57 2008
@@ -2621,6 +2621,11 @@ int run_command(MPContext * mpctx, mp_cm
 	    }
 	    break;
 
+	case MP_CMD_STOP:
+	    mpctx->eof = PT_STOP;
+	    brk_cmd = 1;
+	    break;
+
 #ifdef USE_RADIO
 	case MP_CMD_RADIO_STEP_CHANNEL:
 	    if (mpctx->demuxer->stream->type == STREAMTYPE_RADIO) {

Modified: trunk/input/input.c
==============================================================================
--- trunk/input/input.c	(original)
+++ trunk/input/input.c	Tue May 27 20:39:57 2008
@@ -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_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_STOP, "stop", 0, { {-1,{0}} } },
   { MP_CMD_PAUSE, "pause", 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}} } },
@@ -473,6 +474,7 @@ static const mp_cmd_bind_t def_cmd_binds
   { { '!', 0 }, "seek_chapter -1" },
   { { '@', 0 }, "seek_chapter 1" },
   { { 'A', 0 }, "switch_angle 1" },
+  { { 'U', 0 }, "stop" },
 
   { { 0 }, NULL }
 };

Modified: trunk/input/input.h
==============================================================================
--- trunk/input/input.h	(original)
+++ trunk/input/input.h	Tue May 27 20:39:57 2008
@@ -109,6 +109,7 @@
 #define MP_CMD_SWITCH_ANGLE 105
 #define MP_CMD_ASS_USE_MARGINS 106
 #define MP_CMD_SWITCH_TITLE 107
+#define MP_CMD_STOP 108
 
 #define MP_CMD_GUI_EVENTS       5000
 #define MP_CMD_GUI_LOADFILE     5001

Modified: trunk/mp_core.h
==============================================================================
--- trunk/mp_core.h	(original)
+++ trunk/mp_core.h	Tue May 27 20:39:57 2008
@@ -39,6 +39,7 @@
 #define PT_PREV_SRC -2
 #define PT_UP_NEXT 3
 #define PT_UP_PREV -3
+#define PT_STOP 4
 
 
 typedef struct MPContext {

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	(original)
+++ trunk/mplayer.c	Tue May 27 20:39:57 2008
@@ -3998,6 +3998,9 @@ if(mpctx->eof == PT_NEXT_ENTRY || mpctx-
             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
     mpctx->eof = mpctx->eof == PT_PREV_SRC ? -1 : 1;
 }



More information about the MPlayer-cvslog mailing list