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;
Alban Bedel CVS writes:
Modified Files: parser-mpcmd.c Log Message: Basic support for random playing (-rnd and -nornd)
Why not call this -random? We generally use human readable options, loop, input, info, benchmark, framedrop, etc... Diego
On Wed, 13 Nov 2002 00:41:36 +0100 Alban Bedel CVS <albeu@mplayerhq.hu> wrote:
+ } 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) {
Does anyone mind if i change this to "random" resp "norandom" ? I agree here with Diego that it is more userfriendly. Attila Kinali -- He! Do sitzed jo Fraue wo i nöd kenne! Was mached die do ? -- Emi im ETZ
participants (3)
-
Alban Bedel CVS -
Attila Kinali -
Diego Biurrun