[vlc-devel] commit: libvlc_media_player_get_media: missing lock ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sun Jul 12 22:21:29 CEST 2009
vlc | branch: 1.0-bugfix | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 12 23:18:23 2009 +0300| [8ad6691b42fee7e69bde5d90cdd53c213686f86c] | committer: Rémi Denis-Courmont
libvlc_media_player_get_media: missing lock
Test cases are still *always* crashing in 1.0-bugfix...
(cherry picked from commit bd0571c57b0c0ca33118c31a6f18d5d66d91f02c)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8ad6691b42fee7e69bde5d90cdd53c213686f86c
---
src/control/media_player.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/control/media_player.c b/src/control/media_player.c
index d8918c2..477b77c 100644
--- a/src/control/media_player.c
+++ b/src/control/media_player.c
@@ -552,12 +552,14 @@ libvlc_media_player_get_media(
libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
{
+ libvlc_media_t *p_m;
VLC_UNUSED(p_e);
- if( !p_mi->p_md )
- return NULL;
-
- libvlc_media_retain( p_mi->p_md );
+ vlc_mutex_lock( &p_mi->object_lock );
+ p_m = p_mi->p_md;
+ if( p_m )
+ libvlc_media_retain( p_mi->p_md );
+ vlc_mutex_unlock( &p_mi->object_lock );
return p_mi->p_md;
}
More information about the vlc-devel
mailing list