]> git.sesse.net Git - vlc/commitdiff
libvlc: media: lock media_list
authorThomas Guillem <thomas@gllm.fr>
Mon, 19 Jan 2015 10:22:50 +0000 (11:22 +0100)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 20 Jan 2015 06:17:18 +0000 (08:17 +0200)
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
lib/media.c

index f65d40549348984c6eb884b53114a5d3b6af1eb6..c73c5b1859bed0fd8ed7a9bc9467a0e05252f305 100644 (file)
@@ -141,7 +141,11 @@ static void input_item_subitem_added( const vlc_event_t *p_event,
     /* Add this to our media list */
     p_subitems = media_get_subitems( p_md );
     if( p_subitems != NULL )
+    {
+        libvlc_media_list_lock( p_subitems );
         libvlc_media_list_internal_add_media( p_subitems, p_md_child );
+        libvlc_media_list_unlock( p_subitems );
+    }
 
     /* Construct the event */
     event.type = libvlc_MediaSubItemAdded;