control/media_descriptor.c: Give access to the subitems.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 24 Aug 2007 21:54:27 +0000 (21:54 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 24 Aug 2007 21:54:27 +0000 (21:54 +0000)
include/vlc/libvlc.h
src/control/media_descriptor.c

index fbed729..5bc7453 100644 (file)
@@ -233,6 +233,10 @@ VLC_PUBLIC_API libvlc_tag_t
                                                   const char * key,
                                                   libvlc_exception_t *p_e );
 
+VLC_PUBLIC_API libvlc_media_list_t *
+    libvlc_media_descriptor_subitems( libvlc_media_descriptor_t *p_md,
+                                      libvlc_exception_t *p_e );
+
 /** @}*/
 
 /*****************************************************************************
index 77955b4..2c49a99 100644 (file)
@@ -253,7 +253,8 @@ void libvlc_media_descriptor_release( libvlc_media_descriptor_t *p_md )
     if( p_md->i_refcount > 0 )
         return;
 
-    libvlc_media_list_release( p_md->p_subitems );
+    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 );
@@ -437,3 +438,14 @@ libvlc_media_descriptor_tag_at_index_for_key( libvlc_media_descriptor_t *p_md,
     return strdup( p_ts->ppsz_tags[i] );
 }
 
+/**************************************************************************
+ * subitems
+ **************************************************************************/
+libvlc_media_list_t *
+libvlc_media_descriptor_subitems( libvlc_media_descriptor_t * p_md,
+                                  libvlc_exception_t * p_e )
+{
+    libvlc_media_list_retain( p_md->p_subitems );
+    return p_md->p_subitems;
+}
+