]> git.sesse.net Git - vlc/commitdiff
media_list_player: Instance variable access should be done behind a lock.
authorPierre d'Herbemont <pdherbemont@free.fr>
Mon, 29 Jun 2009 01:35:10 +0000 (18:35 -0700)
committerPierre d'Herbemont <pdherbemont@free.fr>
Mon, 29 Jun 2009 01:35:10 +0000 (18:35 -0700)
src/control/media_list_player.c

index e532dec0336d1fa65f1622e534576ca7e6c7401e..a106ff5aff3477dd1b6649614701cf7a2ce2e3ca 100644 (file)
@@ -502,6 +502,8 @@ void libvlc_media_list_player_play_item(
 void libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
                                     libvlc_exception_t * p_e )
 {
+    vlc_mutex_lock( &p_mlp->object_lock );
+
     if ( p_mlp->p_mi )
     {
         /* We are not interested in getting media stop event now */
@@ -510,7 +512,6 @@ void libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
         install_media_player_observer( p_mlp );
     }
 
-    vlc_mutex_lock( &p_mlp->object_lock );
     free( p_mlp->current_playing_item_path );
     p_mlp->current_playing_item_path = NULL;
     vlc_mutex_unlock( &p_mlp->object_lock );