[vlc-devel] [PATCH] fixed threading issue in libvlc_media_player_get_media

Sergey Radionov rsatom at gmail.com
Sun Apr 6 12:49:30 CEST 2014


and some cosmetics
---
 lib/media_player.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/media_player.c b/lib/media_player.c
index 8eee79c..67bbde7 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -691,12 +691,13 @@ libvlc_media_player_get_media( libvlc_media_player_t *p_mi )
 {
     libvlc_media_t *p_m;
 
-    lock(p_mi);
+    lock( p_mi );
     p_m = p_mi->p_md;
     if( p_m )
-        libvlc_media_retain( p_mi->p_md );
-    unlock(p_mi);
-    return p_mi->p_md;
+        libvlc_media_retain( p_m );
+    unlock( p_mi );
+
+    return p_m;
 }
 
 /**************************************************************************
-- 
1.9.0.msysgit.0




More information about the vlc-devel mailing list