summaryrefslogtreecommitdiffstats
path: root/playtree.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-20 17:30:29 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-20 17:30:29 +0000
commitef8f08572b8e6e6a5f3a9a76f8a0654d941a8dd2 (patch)
tree4614eda576d5242d81b992a42796a768bfb7fa2c /playtree.c
parenta96207679ede691c774e83671f676c8865215756 (diff)
downloadmpv-ef8f08572b8e6e6a5f3a9a76f8a0654d941a8dd2.tar.bz2
mpv-ef8f08572b8e6e6a5f3a9a76f8a0654d941a8dd2.tar.xz
fix -loop in combination with -shuffle
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13709 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'playtree.c')
-rw-r--r--playtree.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/playtree.c b/playtree.c
index 6d3c4f42da..373bbfb575 100644
--- a/playtree.c
+++ b/playtree.c
@@ -585,6 +585,14 @@ play_tree_iter_step(play_tree_iter_t* iter, int d,int with_nodes) {
if(pt == NULL) { // No next
// 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(d > 0) { // Go back to the first one
for(pt = iter->tree ; pt->prev != NULL; pt = pt->prev)