[MPlayer-users] adding files to mplayer playtree

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Wed Aug 10 13:58:13 CEST 2005


Hi,
On Wed, Aug 10, 2005 at 01:52:45PM +0200, Reimar D?ffinger wrote:
> On Wed, Aug 10, 2005 at 03:59:01AM -0700, sri raman wrote:
> > load file and load list will replace existing list
> 
> Right, try the attached patch (with e.g. loadfile file.avi 1).

... as usual...
-------------- next part --------------
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.859
diff -u -r1.859 mplayer.c
--- mplayer.c	5 Aug 2005 19:57:44 -0000	1.859
+++ mplayer.c	10 Aug 2005 11:49:59 -0000
@@ -2998,6 +3035,9 @@
       play_tree_t* e = play_tree_new();
       play_tree_add_file(e,cmd->args[0].v.s);
 
+      if (cmd->args[1].v.i) // append
+        play_tree_append_entry(playtree, e);
+      else {
       // Go back to the start point
       while(play_tree_iter_up_step(playtree_iter,0,1) != PLAY_TREE_ITER_END)
 	/* NOP */;
@@ -3005,6 +3045,7 @@
       play_tree_set_child(playtree,e);
       play_tree_iter_step(playtree_iter,0,0);
       eof = PT_NEXT_SRC;
+      }
       brk_cmd = 1;
     } break;
     case MP_CMD_LOADLIST : {
@@ -3012,6 +3053,9 @@
       if(!e)
 	mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_PlaylistLoadUnable,cmd->args[0].v.s);
       else {
+	if (cmd->args[1].v.i) // append
+	  play_tree_append_entry(playtree, e);
+	else {
 	// Go back to the start point
 	while(play_tree_iter_up_step(playtree_iter,0,1) != PLAY_TREE_ITER_END)
 	  /* NOP */;
@@ -3019,6 +3063,7 @@
 	play_tree_set_child(playtree,e);
 	play_tree_iter_step(playtree_iter,0,0);
 	eof = PT_NEXT_SRC;	
+	}
       }
       brk_cmd = 1;
     } break;
Index: input/input.c
===================================================================
RCS file: /cvsroot/mplayer/main/input/input.c,v
retrieving revision 1.119
diff -u -r1.119 input.c
--- input/input.c	23 Jul 2005 16:54:45 -0000	1.119
+++ input/input.c	10 Aug 2005 11:51:28 -0000
@@ -110,8 +112,8 @@
   { MP_CMD_SCREENSHOT, "screenshot", 0, { {-1,{0}} } },
   { MP_CMD_PANSCAN, "panscan",1,  { {MP_CMD_ARG_FLOAT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
   { MP_CMD_SWITCH_VSYNC, "switch_vsync", 0, { {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
-  { MP_CMD_LOADFILE, "loadfile", 1, { {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } },
-  { MP_CMD_LOADLIST, "loadlist", 1, { {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } },
+  { MP_CMD_LOADFILE, "loadfile", 1, { {MP_CMD_ARG_STRING, {0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
+  { MP_CMD_LOADLIST, "loadlist", 1, { {MP_CMD_ARG_STRING, {0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
   { MP_CMD_RUN, "run", 1, { {MP_CMD_ARG_STRING,{0}}, {-1,{0}} } },
   { MP_CMD_VF_CHANGE_RECTANGLE, "change_rectangle", 2, { {MP_CMD_ARG_INT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}}}},
 
Index: DOCS/tech/slave.txt
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/tech/slave.txt,v
retrieving revision 1.40
diff -u -r1.40 slave.txt
--- DOCS/tech/slave.txt	13 Jul 2005 00:34:37 -0000	1.40
+++ DOCS/tech/slave.txt	10 Aug 2005 11:55:39 -0000
@@ -173,11 +173,15 @@
     If <absolute> is != 0, then the pan-and scan range is interpreted as an
     absolute range.
 
-loadfile <file|url>
+loadfile <file|url> <append>
     Load the given file/URL.
+    If <append> is 0 or not given playback of the current file will be stopped
+    and the playlist replaced. Otherwise it will only be added to the playlist.
 
-loadlist <file>
+loadlist <file> <append>
     Load the given playlist file.
+    If <append> is 0 or not given playback of the current file will be stopped
+    and the playlist replaced. Otherwise it will only be added to the playlist.
 
 change_rectangle <val1> <val2>
     Change the position of the rectangle filter rectangle.


More information about the MPlayer-users mailing list