[vlc-devel] commit: libvlc_media_player_retain: missing lock ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed May 13 17:53:58 CEST 2009


vlc | branch: 0.9-bugfix | Rémi Denis-Courmont <remi at remlab.net> | Wed May 13 18:51:01 2009 +0300| [20cde79dabcc32ea152daa3da4c48502bb682c25] | committer: Rémi Denis-Courmont 

libvlc_media_player_retain: missing lock
(cherry picked from commit 9a1855005d5505976b5d077fdd5c42813b603b19)

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

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

diff --git a/src/control/media_player.c b/src/control/media_player.c
index 0928900..96ab8dc 100644
--- a/src/control/media_player.c
+++ b/src/control/media_player.c
@@ -505,10 +505,11 @@ void libvlc_media_player_release( libvlc_media_player_t *p_mi )
  **************************************************************************/
 void libvlc_media_player_retain( libvlc_media_player_t *p_mi )
 {
-    if( !p_mi )
-        return;
+    assert( p_mi );
 
+    vlc_mutex_lock( &p_mi->object_lock );
     p_mi->i_refcount++;
+    vlc_mutex_unlock( &p_mi->object_lock );
 }
 
 /**************************************************************************




More information about the vlc-devel mailing list