* Includes
*****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <vlc/vlc.h>
#include <vlc_playlist.h>
#include <vlc_arrays.h>
{
services_discovery_t *p_sd = ( services_discovery_t* )userdata;
services_discovery_sys_t *p_sys = p_sd->p_sys;
+
+ VLC_UNUSED(interface); VLC_UNUSED(host_name);
+#ifdef HAVE_AVAHI_06
+ VLC_UNUSED(flags);
+#endif
#ifdef HAVE_AVAHI_06
if( event == AVAHI_RESOLVER_FAILURE )
avahi_address_snprint(a, (sizeof(a)/sizeof(a[0]))-1, address);
if( protocol == AVAHI_PROTO_INET6 )
- asprintf( &psz_addr, "[%s]", a );
+ if( asprintf( &psz_addr, "[%s]", a ) == -1 )
+ return;
if( txt != NULL )
asl = avahi_string_list_find( txt, "path" );
if( avahi_string_list_get_pair( asl, &key, &value, &size ) == 0 &&
value != NULL )
{
- asprintf( &psz_uri, "http://%s:%d%s",
- psz_addr != NULL ? psz_addr : a, port, value );
+ if( asprintf( &psz_uri, "http://%s:%d%s",
+ psz_addr != NULL ? psz_addr : a, port, value ) == -1 )
+ {
+ free( psz_addr );
+ return;
+ }
}
if( key != NULL )
avahi_free( (void *)key );
}
else
{
- asprintf( &psz_uri, "http://%s:%d",
- psz_addr != NULL ? psz_addr : a, port );
+ if( asprintf( &psz_uri, "http://%s:%d",
+ psz_addr != NULL ? psz_addr : a, port ) == -1 )
+ {
+ free( psz_addr );
+ return;
+ }
}
if( psz_addr != NULL )
vlc_dictionary_insert( &p_sys->services_name_to_input_item,
name, p_input );
services_discovery_AddItem( p_sd, p_input, NULL /* no category */ );
+ vlc_gc_decref( p_input );
}
}
#endif
void* userdata )
{
+ VLC_UNUSED(b);
+#ifdef HAVE_AVAHI_06
+ VLC_UNUSED(flags);
+#endif
services_discovery_t *p_sd = ( services_discovery_t* )userdata;
services_discovery_sys_t *p_sys = p_sd->p_sys;
-
if( event == AVAHI_BROWSER_NEW )
{
if( avahi_service_resolver_new( p_sys->client, interface, protocol,
avahi_strerror( avahi_client_errno( p_sys->client ) ) );
}
}
- else
+ else if( name )
{
/** \todo Store the input id and search it, rather than searching the items */
input_item_t *p_item;