]> git.sesse.net Git - vlc/blobdiff - src/playlist/services_discovery.c
update module LIST file.
[vlc] / src / playlist / services_discovery.c
index 3c892eb9bcb8705788bb41d47dc7927e4ef45d70..3c89c48534f9ac61c95371694d7f5cc53031c5c4 100644 (file)
@@ -29,6 +29,7 @@
 #include "vlc_playlist.h"
 #include "vlc_events.h"
 #include "playlist_internal.h"
+#include "../libvlc.h"
 
 static void RunSD( services_discovery_t *p_sd );
 
@@ -55,7 +56,9 @@ char ** __services_discovery_GetServicesNames( vlc_object_t * p_super,
 services_discovery_t *
 services_discovery_Create ( vlc_object_t * p_super, const char * psz_module_name )
 {
-    services_discovery_t *p_sd = vlc_object_create( p_super, VLC_OBJECT_SD );
+    services_discovery_t *p_sd;
+    p_sd = vlc_custom_create( p_super, sizeof( *p_sd ), VLC_OBJECT_GENERIC,
+                              "services discovery" );
     if( !p_sd )
         return NULL;
 
@@ -143,7 +146,7 @@ services_discovery_GetLocalizedName ( services_discovery_t * p_sd )
 void
 services_discovery_SetLocalizedName ( services_discovery_t * p_sd, const char *psz )
 {
-    if(p_sd->psz_localized_name) free( p_sd->psz_localized_name );
+    free( p_sd->psz_localized_name );
     p_sd->psz_localized_name = strdup(psz);
 }
 
@@ -234,8 +237,11 @@ static void playlist_sd_item_added( const vlc_event_t * p_event, void * user_dat
 
     p_new_item = playlist_NodeAddInput( p_parent->p_playlist, p_input, p_parent,
                                         PLAYLIST_APPEND, PLAYLIST_END, VLC_FALSE );
-    p_new_item->i_flags &= ~PLAYLIST_SKIP_FLAG;
-    p_new_item->i_flags &= ~PLAYLIST_SAVE_FLAG;
+    if( p_new_item )
+    {
+        p_new_item->i_flags &= ~PLAYLIST_SKIP_FLAG;
+        p_new_item->i_flags &= ~PLAYLIST_SAVE_FLAG;
+    }
 }
 
  /* A new item has been removed from a certain sd */