[vlc-commits] fixed threading issue in libvlc_media_player_get_media

Sergey Radionov git at videolan.org
Sun Apr 6 14:22:57 CEST 2014


vlc | branch: master | Sergey Radionov <rsatom at gmail.com> | Sun Apr  6 17:49:30 2014 +0700| [ae904d83446a00457e3618398b2ebffb84fabed4] | committer: Rémi Denis-Courmont

fixed threading issue in libvlc_media_player_get_media

and some cosmetics

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 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;
 }
 
 /**************************************************************************



More information about the vlc-commits mailing list