mirror of
https://github.com/mpv-player/mpv
synced 2025-01-18 04:51:52 +00:00
Basic support for random playing (-rnd and -nornd)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8176 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
5a4c2c738e
commit
b3044d0feb
@ -177,6 +177,8 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv)
|
||||
{
|
||||
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 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv)
|
||||
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 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv)
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user