[vlc-devel] commit: media_list_player: Instance variable access should be done behind a lock. (Pierre d' Herbemont )

git version control git at videolan.org
Mon Jun 29 03:35:44 CEST 2009


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Sun Jun 28 18:35:10 2009 -0700| [d4dd4001a33f23d0aedb5e3982705324dbcc0eb0] | committer: Pierre d'Herbemont 

media_list_player: Instance variable access should be done behind a lock.

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

 src/control/media_list_player.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/control/media_list_player.c b/src/control/media_list_player.c
index e532dec..a106ff5 100644
--- a/src/control/media_list_player.c
+++ b/src/control/media_list_player.c
@@ -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 );




More information about the vlc-devel mailing list