[vlc-commits] playlist: fix infinite loop while clearing the playlist

Rémi Denis-Courmont git at videolan.org
Wed Dec 24 09:33:57 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 24 10:33:27 2014 +0200| [9ef79c687938c664e0f3bd2d2ff1487b0bcad19c] | committer: Rémi Denis-Courmont

playlist: fix infinite loop while clearing the playlist

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9ef79c687938c664e0f3bd2d2ff1487b0bcad19c
---

 src/playlist/thread.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/playlist/thread.c b/src/playlist/thread.c
index 86c1503..62085d9 100644
--- a/src/playlist/thread.c
+++ b/src/playlist/thread.c
@@ -253,6 +253,10 @@ static playlist_item_t *NextItem( playlist_t *p_playlist )
 {
     playlist_private_t *p_sys = pl_priv(p_playlist);
     playlist_item_t *p_new = NULL;
+    bool requested = p_sys->request.b_request;
+
+    /* Clear the request */
+    p_sys->request.b_request = false;
 
     /* Handle quickly a few special cases */
     /* No items to play */
@@ -263,11 +267,8 @@ static playlist_item_t *NextItem( playlist_t *p_playlist )
     }
 
     /* Start the real work */
-    if( p_sys->request.b_request )
+    if( requested )
     {
-        /* Clear the request */
-        p_sys->request.b_request = false;
-
         p_new = p_sys->request.p_item;
 
         if( p_new == NULL && p_sys->request.p_node == NULL )



More information about the vlc-commits mailing list