[vlc-devel] commit: Fix randomization in previous commit ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue May 26 18:37:20 CEST 2009


vlc | branch: 1.0-bugfix | Rémi Denis-Courmont <remi at remlab.net> | Tue May 26 19:37:01 2009 +0300| [9e1a568b976a8de6d05f1f8aab0d82caa912ecae] | committer: Rémi Denis-Courmont 

Fix randomization in previous commit

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

 src/playlist/sort.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/playlist/sort.c b/src/playlist/sort.c
index cb973fd..dd477fb 100644
--- a/src/playlist/sort.c
+++ b/src/playlist/sort.c
@@ -113,10 +113,6 @@ static int playlist_ItemArraySort( playlist_t *p_playlist, int i_items,
     int i_position;
     playlist_item_t *p_temp;
 
-    vlc_mutex_lock( &sort_lock );
-    sort_mode = i_mode;
-    sort_type = i_type;
-
     (void)p_playlist; // a bit surprising we don't need p_playlist!
 
     if( i_mode == SORT_RANDOM )
@@ -136,6 +132,10 @@ static int playlist_ItemArraySort( playlist_t *p_playlist, int i_items,
 
         return VLC_SUCCESS;
     }
+
+    vlc_mutex_lock( &sort_lock );
+    sort_mode = i_mode;
+    sort_type = i_type;
     qsort(pp_items,i_items,sizeof(pp_items[0]),playlist_cmp);
     vlc_mutex_unlock( &sort_lock );
     return VLC_SUCCESS;




More information about the vlc-devel mailing list