]> git.sesse.net Git - vlc/blobdiff - src/control/media_descriptor.c
Removes trailing spaces. Removes tabs.
[vlc] / src / control / media_descriptor.c
index 03762a7411f0ae8fe54420f4d3a35531f67502d9..7067cc199273e0750a99d71d60f6bdce5a5783cc 100644 (file)
@@ -83,13 +83,16 @@ static void input_item_subitem_added( const vlc_event_t *p_event,
     libvlc_event_t event;
 
     p_md_child = libvlc_media_descriptor_new_from_input_item(
-                p_md->p_libvlc_instance, 
+                p_md->p_libvlc_instance,
                 p_event->u.input_item_subitem_added.p_new_child, NULL );
 
     /* Add this to our media list */
     if( !p_md->p_subitems )
+    {
         p_md->p_subitems = libvlc_media_list_new( p_md->p_libvlc_instance, NULL );
-    if( !p_md->p_subitems )
+        libvlc_media_list_set_media_descriptor( p_md->p_subitems, p_md, NULL );
+    }
+    if( p_md->p_subitems )
     {
         libvlc_media_list_add_media_descriptor( p_md->p_subitems, p_md_child, NULL );
     }
@@ -192,7 +195,7 @@ libvlc_media_descriptor_t * libvlc_media_descriptor_new_from_input_item(
     p_md = malloc( sizeof(libvlc_media_descriptor_t) );
     p_md->p_libvlc_instance = p_instance;
     p_md->p_input_item      = p_input_item;
-    p_md->b_preparsed       = VLC_TRUE;
+    p_md->b_preparsed       = VLC_FALSE;
     p_md->i_refcount        = 1;
 
     /* A media descriptor can be a playlist. When you open a playlist
@@ -202,9 +205,9 @@ libvlc_media_descriptor_t * libvlc_media_descriptor_new_from_input_item(
     vlc_dictionary_init( &p_md->tags, 1 );
 
     p_md->p_event_manager = libvlc_event_manager_new( p_md, p_instance, p_e );
-    libvlc_event_manager_register_event_type( p_md->p_event_manager, 
+    libvlc_event_manager_register_event_type( p_md->p_event_manager,
         libvlc_MediaDescriptorMetaChanged, p_e );
-    libvlc_event_manager_register_event_type( p_md->p_event_manager, 
+    libvlc_event_manager_register_event_type( p_md->p_event_manager,
         libvlc_MediaDescriptorSubItemAdded, p_e );
 
     vlc_gc_incref( p_md->p_input_item );
@@ -346,7 +349,7 @@ void libvlc_media_descriptor_add_tag( libvlc_media_descriptor_t *p_md,
 
     if( !tag || !key )
         return;
-    
     p_ts = vlc_dictionary_value_for_key( &p_md->tags, key );
 
     if( !p_ts )
@@ -360,7 +363,7 @@ void libvlc_media_descriptor_add_tag( libvlc_media_descriptor_t *p_md,
         p_ts->ppsz_tags = malloc(sizeof(char*)*(p_ts->i_count));
     else
         p_ts->ppsz_tags = realloc(p_ts->ppsz_tags, sizeof(char*)*(p_ts->i_count));
-        
     p_ts->ppsz_tags[p_ts->i_count-1] = strdup( tag );
 }
 
@@ -378,7 +381,7 @@ void libvlc_media_descriptor_remove_tag( libvlc_media_descriptor_t *p_md,
 
     if( !tag || !key )
         return;
-    
     p_ts = vlc_dictionary_value_for_key( &p_md->tags, key );
 
     if( !p_ts )
@@ -408,7 +411,7 @@ int libvlc_media_descriptor_tags_count_for_key( libvlc_media_descriptor_t *p_md,
 
     if( !key )
         return 0;
-    
     p_ts = vlc_dictionary_value_for_key( &p_md->tags, key );
 
     if( !p_ts )
@@ -429,12 +432,12 @@ libvlc_media_descriptor_tag_at_index_for_key( libvlc_media_descriptor_t *p_md,
 
     if( !key )
         return NULL;
-    
     p_ts = vlc_dictionary_value_for_key( &p_md->tags, key );
 
     if( !p_ts )
         return NULL;
-    
     return strdup( p_ts->ppsz_tags[i] );
 }