[vlc-commits] libvlc: don't release media_list while it's used by media

Thomas Guillem git at videolan.org
Thu Nov 5 13:11:06 CET 2015


vlc/vlc-2.2 | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Nov  5 12:35:21 2015 +0100| [863a4259336594469436fa072f7277e4924721f5] | committer: Jean-Baptiste Kempf

libvlc: don't release media_list while it's used by media

Indeed, events callbacks can access the media_list.

(cherry picked from commit 860f831fc1ee17caca4225e40bb78fc5b8964dc7)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 lib/media.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/media.c b/lib/media.c
index 6f324aa..18d6e6d 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -435,10 +435,11 @@ void libvlc_media_release( libvlc_media_t *p_md )
     if( p_md->i_refcount > 0 )
         return;
 
+    uninstall_input_item_observer( p_md );
+
     if( p_md->p_subitems )
         libvlc_media_list_release( p_md->p_subitems );
 
-    uninstall_input_item_observer( p_md );
     vlc_gc_decref( p_md->p_input_item );
 
     vlc_cond_destroy( &p_md->parsed_cond );



More information about the vlc-commits mailing list