[Mplayer-cvslog] CVS: main parser-mpcmd.c,1.1,1.2
Alban Bedel CVS
albeu at mplayerhq.hu
Wed Nov 13 00:41:36 CET 2002
Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv5727
Modified Files:
parser-mpcmd.c
Log Message:
Basic support for random playing (-rnd and -nornd)
Index: parser-mpcmd.c
===================================================================
RCS file: /cvsroot/mplayer/main/parser-mpcmd.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- parser-mpcmd.c 12 Nov 2002 01:56:21 -0000 1.1
+++ parser-mpcmd.c 12 Nov 2002 23:41:32 -0000 1.2
@@ -177,6 +177,8 @@
{
play_tree_t* entry = play_tree_new();
UNSET_GLOBAL;
+ if(last_parent->flags & PLAY_TREE_RND)
+ entry->flags |= PLAY_TREE_RND;
if(last_entry == NULL) {
play_tree_set_child(last_parent,entry);
} else {
@@ -222,6 +224,16 @@
pt->loop = l;
tmp = 1;
}
+ } else if(strcasecmp(opt,"rnd") == 0) {
+ if(last_entry && last_entry->child)
+ last_entry->flags |= PLAY_TREE_RND;
+ else
+ last_parent->flags |= PLAY_TREE_RND;
+ } else if(strcasecmp(opt,"nornd") == 0) {
+ if(last_entry && last_entry->child)
+ last_entry->flags &= ~PLAY_TREE_RND;
+ else
+ last_parent->flags &= ~PLAY_TREE_RND;
} else {
m_option_t* mp_opt = NULL;
play_tree_t* entry = NULL;
@@ -230,6 +242,8 @@
if(tmp > 0) { // It's an entry
if(entry) {
add_entry(entry);
+ if((last_parent->flags & PLAY_TREE_RND) && entry->child)
+ entry->flags |= PLAY_TREE_RND;
UNSET_GLOBAL;
} else if(mode == LOCAL) // Entry is empty we have to drop his params
mode = DROP_LOCAL;
More information about the MPlayer-cvslog
mailing list