]> git.sesse.net Git - vlc/blobdiff - src/playlist/thread.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / src / playlist / thread.c
index 0ed215e7e7205cd4ee4a90b9a2b20e4b580c3db8..a87881c499301fde2ade3ff9406f8729ef52a51e 100644 (file)
@@ -84,7 +84,10 @@ void playlist_Deactivate( playlist_t *p_playlist )
 
     /* release input resources */
     if( p_sys->p_input_resource )
-        input_resource_Delete( p_sys->p_input_resource );
+    {
+        input_resource_Terminate( p_sys->p_input_resource );
+        input_resource_Release( p_sys->p_input_resource );
+    }
     p_sys->p_input_resource = NULL;
 
     if( var_InheritBool( p_playlist, "media-library" ) )
@@ -192,7 +195,7 @@ static void ResetCurrentlyPlaying( playlist_t *p_playlist,
         /* Shuffle the array */
         for( unsigned j = p_playlist->current.i_size - 1; j > 0; j-- )
         {
-            unsigned i = ((unsigned)vlc_mrand48()) % (j+1); /* between 0 and j */
+            unsigned i = vlc_lrand48() % (j+1); /* between 0 and j */
             playlist_item_t *p_tmp;
             /* swap the two items */
             p_tmp = ARRAY_VAL(p_playlist->current, i);