]> git.sesse.net Git - vlc/commitdiff
Restore SD human-readable names
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sat, 10 Jan 2009 17:11:31 +0000 (19:11 +0200)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sat, 10 Jan 2009 17:11:31 +0000 (19:11 +0200)
include/vlc_services_discovery.h
modules/services_discovery/bonjour.c
modules/services_discovery/hal.c
modules/services_discovery/podcast.c
modules/services_discovery/sap.c
modules/services_discovery/shout.c
modules/services_discovery/upnp_cc.cpp
modules/services_discovery/upnp_intel.cpp
src/libvlccore.sym
src/playlist/services_discovery.c

index e6778af30ed58d9da94e3be8065d242d3a1c0c4e..ac50559a3d3a5fd9201de2766049396f384dd050 100644 (file)
@@ -46,7 +46,6 @@ struct services_discovery_t
     char *              psz_module;
     module_t *          p_module;
 
-    char *              psz_localized_name; /* Accessed through Setters for non class function */
     vlc_event_manager_t event_manager;      /* Accessed through Setters for non class function */
 
     services_discovery_sys_t *p_sys;
@@ -86,7 +85,6 @@ VLC_EXPORT( char *,                 services_discovery_GetLocalizedName, ( servi
 VLC_EXPORT( vlc_event_manager_t *,  services_discovery_EventManager, ( services_discovery_t * p_this ) );
 
 /* Used by services_discovery to post update about their items */
-VLC_EXPORT( void,                   services_discovery_SetLocalizedName, ( services_discovery_t * p_this, const char * ) );
     /* About the psz_category, it is a legacy way to add info to the item,
      * for more options, directly set the (meta) data on the input item */
 VLC_EXPORT( void,                   services_discovery_AddItem, ( services_discovery_t * p_this, input_item_t * p_item, const char * psz_category ) );
index 23a30e877fb12ac6ba46ed6b93b82641464bc10b..a22bbe8aa6f48faf50a130c3f12f907e6def0821 100644 (file)
@@ -282,8 +282,6 @@ static int Open( vlc_object_t *p_this )
         goto error;
     }
 
-    services_discovery_SetLocalizedName( p_sd, _("Bonjour") );
-
     return VLC_SUCCESS;
 
 error:
index bd4e8e1c7da384bf2b1a27d7ebac13523dd3e81b..a4ef70320758279d6d35a35801755cb42cd5ea0c 100644 (file)
@@ -145,8 +145,6 @@ static int Open( vlc_object_t *p_this )
     if( vlc_clone( &p_sys->thread, Run, p_this, VLC_THREAD_PRIORITY_LOW ) )
         goto error;
 
-    services_discovery_SetLocalizedName( p_sd, _("Devices") );
-
     return VLC_SUCCESS;
 error:
     dbus_error_free( &dbus_error );
index a59ae2ecfc1c2a2b18fc564f3ca7f052682325f8..ceaf68f027f089cf39749d2a6cfbdb14b443bf8f 100644 (file)
@@ -123,8 +123,6 @@ static int Open( vlc_object_t *p_this )
     p_sys->b_update = true;
 
     p_sd->p_sys  = p_sys;
-    /* Give us a name */
-    services_discovery_SetLocalizedName( p_sd, _("Podcasts") );
 
     /* Launch the callback associated with this variable */
     var_Create( p_sd, "podcast-urls", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
index 6e61f2238ed2d67ae2b2acde5f11c119f22bebfd..159a5817e225386861ae0bb5972e92dee1a87d7e 100644 (file)
@@ -320,9 +320,6 @@ static int Open( vlc_object_t *p_this )
     /* Cache sap_timeshift value */
     p_sys->b_timeshift = var_CreateGetInteger( p_sd, "sap-timeshift" );
 
-    /* Set our name */
-    services_discovery_SetLocalizedName( p_sd, _("SAP") );
-
     p_sys->i_announces = 0;
     p_sys->pp_announces = NULL;
     /* TODO: create sockets here, and fix racy sockets table */
index c6148bac272ab5a390da620f81c116c2e492c181..2e4191bc37cc5287d69041628c341306b1dc9612 100644 (file)
@@ -153,7 +153,6 @@ struct services_discovery_sys_t
 static int Open( vlc_object_t *p_this, enum type_e i_type )
 {
     services_discovery_t *p_sd = ( services_discovery_t* )p_this;
-    services_discovery_SetLocalizedName( p_sd, _(p_items[i_type].psz_name) );
 
     p_sd->p_sys = malloc (sizeof (*(p_sd->p_sys)));
     if (p_sd->p_sys == NULL)
index 3ec13c11aeb55c0b0e679243d40c9d64604da167..09bce0f79dba5bbf4828148aacfd12c19cdfeb16 100644 (file)
@@ -125,8 +125,6 @@ static int Open( vlc_object_t *p_this )
 {
     services_discovery_t *p_sd = ( services_discovery_t* )p_this;
 
-    services_discovery_SetLocalizedName( p_sd, _("Devices") );
-
     UPnPHandler *u = new UPnPHandler( p_sd );
     u->start( );
     msg_Dbg( p_sd, "upnp discovery started" );
index 3876947df76f57816e0652c14af796d16b80c0d0..45749e0cc9e598c29b2cc22552a8a516a5844873 100644 (file)
@@ -90,8 +90,6 @@ static int Open( vlc_object_t *p_this )
     if(!(p_sd->p_sys = p_sys))
         return VLC_ENOMEM;
 
-    services_discovery_SetLocalizedName( p_sd, _("UPnP devices") );
-
     res = UpnpInit( 0, 0 );
     if( res != UPNP_E_SUCCESS )
     {
index 74731fc39ad1e6960597e73515b35a8a9683eb41..cccfeea27c7f28315e8712d7d7f5c2df8a5779fa 100644 (file)
@@ -322,7 +322,6 @@ services_discovery_EventManager
 services_discovery_GetLocalizedName
 __services_discovery_GetServicesNames
 services_discovery_RemoveItem
-services_discovery_SetLocalizedName
 services_discovery_Start
 services_discovery_Stop
 sout_AccessOutControl
index 91d0d82b160e0d6229798a2c77547853ab076f65..03b11caef566673ee2bc2e690494f1bbe11c112c 100644 (file)
@@ -64,7 +64,6 @@ services_discovery_Create ( vlc_object_t * p_super, const char * psz_module_name
     if( !p_sd )
         return NULL;
 
-    p_sd->psz_localized_name = strdup( "Unnamed service discovery" ); // FIXME: Set that back to NULL
     p_sd->psz_module = strdup( psz_module_name );
 
     vlc_event_manager_init( &p_sd->event_manager, p_sd, (vlc_object_t *)p_sd );
@@ -141,10 +140,7 @@ static void services_discovery_Destructor ( services_discovery_t * p_sd )
     assert(!p_sd->p_module); /* Forgot to call Stop */
 
     vlc_event_manager_fini( &p_sd->event_manager );
-    
     free( p_sd->psz_module );
-    free( p_sd->psz_localized_name );
-    
     vlc_object_release( p_sd );
 }
 
@@ -154,17 +150,7 @@ static void services_discovery_Destructor ( services_discovery_t * p_sd )
 char *
 services_discovery_GetLocalizedName ( services_discovery_t * p_sd )
 {
-    return p_sd->psz_localized_name ? strdup( p_sd->psz_localized_name ) : NULL;
-}
-
-/***********************************************************************
- * SetLocalizedName
- ***********************************************************************/
-void
-services_discovery_SetLocalizedName ( services_discovery_t * p_sd, const char *psz )
-{
-    free( p_sd->psz_localized_name );
-    p_sd->psz_localized_name = strdup(psz);
+    return strdup( module_get_name( p_sd->p_module, true ) );
 }
 
 /***********************************************************************
@@ -308,15 +294,6 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist,  const char *psz_modu
         if( !p_sd )
             continue;
 
-        /* FIXME: Thanks to previous changeset this is broken */
-        char * psz = services_discovery_GetLocalizedName( p_sd );
-        assert( psz );
-        PL_LOCK;
-        playlist_NodesPairCreate( p_playlist, psz,
-                &p_cat, &p_one, false );
-        PL_UNLOCK;
-        free( psz );
-
         vlc_event_attach( services_discovery_EventManager( p_sd ),
                           vlc_ServicesDiscoveryItemAdded,
                           playlist_sd_item_added,
@@ -343,7 +320,15 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist,  const char *psz_modu
             vlc_object_release( p_sd );
             return VLC_EGENERIC;
         }        
-        
+
+        char *psz = services_discovery_GetLocalizedName( p_sd );
+        assert( psz );
+        PL_LOCK;
+        playlist_NodesPairCreate( p_playlist, psz,
+                &p_cat, &p_one, false );
+        PL_UNLOCK;
+        free( psz );
+
         /* Free in playlist_ServicesDiscoveryRemove */
         p_sds = malloc( sizeof(struct playlist_services_discovery_support_t) );
         if( !p_sds )