0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

fix -loop in combination with -shuffle

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13709 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2004-10-20 17:30:29 +00:00
parent a96207679e
commit ef8f08572b

View File

@ -585,6 +585,14 @@ play_tree_iter_step(play_tree_iter_t* iter, int d,int with_nodes) {
if(pt == NULL) { // No next if(pt == NULL) { // No next
// Must we loop? // Must we loop?
if (iter->mode == PLAY_TREE_ITER_RND) {
if (iter->root->loop == 0)
return PLAY_TREE_ITER_END;
play_tree_unset_flag(iter->root, PLAY_TREE_RND_PLAYED, -1);
if (iter->root->loop > 0) iter->root->loop--;
// try again
return play_tree_iter_step(iter, 0, with_nodes);
} else
if(iter->tree->parent && iter->tree->parent->loop != 0 && ((d > 0 && iter->loop != 0) || ( d < 0 && (iter->loop < 0 || iter->loop < iter->tree->parent->loop) ) ) ) { if(iter->tree->parent && iter->tree->parent->loop != 0 && ((d > 0 && iter->loop != 0) || ( d < 0 && (iter->loop < 0 || iter->loop < iter->tree->parent->loop) ) ) ) {
if(d > 0) { // Go back to the first one if(d > 0) { // Go back to the first one
for(pt = iter->tree ; pt->prev != NULL; pt = pt->prev) for(pt = iter->tree ; pt->prev != NULL; pt = pt->prev)