Commit b1f5c760 authored by Clément Stenac's avatar Clément Stenac

Fix bonjour compilation. Completely untested

parent 4c07fa0c
...@@ -137,7 +137,7 @@ static void resolve_callback( ...@@ -137,7 +137,7 @@ static void resolve_callback(
char *psz_uri = NULL; char *psz_uri = NULL;
char *psz_addr = NULL; char *psz_addr = NULL;
AvahiStringList *asl = NULL; AvahiStringList *asl = NULL;
playlist_item_t *p_item = NULL; input_item_t *p_input = NULL;
msg_Dbg( p_sd, "service '%s' of type '%s' in domain '%s'", msg_Dbg( p_sd, "service '%s' of type '%s' in domain '%s'",
name, type, domain ); name, type, domain );
...@@ -175,16 +175,22 @@ static void resolve_callback( ...@@ -175,16 +175,22 @@ static void resolve_callback(
if( psz_uri != NULL ) if( psz_uri != NULL )
{ {
p_item = playlist_ItemNew( p_sd, psz_uri, name ); p_input = input_ItemNewExt( p_sd, psz_uri, name, 0, NULL, -1 );
free( (void *)psz_uri ); free( (void *)psz_uri );
} }
if( p_item != NULL ) if( p_input != NULL )
{ {
playlist_item_t *p_item;
p_item = playlist_NodeAddInput( p_sys->p_playlist, p_input,
p_sys->p_node_cat,
PLAYLIST_APPEND, PLAYLIST_END );
p_item->i_flags &= ~PLAYLIST_SKIP_FLAG; p_item->i_flags &= ~PLAYLIST_SKIP_FLAG;
p_item->i_flags &= ~PLAYLIST_SAVE_FLAG;
playlist_NodeAddItem( p_sys->p_playlist, p_item, p_item = playlist_NodeAddInput( p_sys->p_playlist, p_input,
VIEW_CATEGORY, p_sys->p_node, p_sys->p_node_one,
PLAYLIST_APPEND, PLAYLIST_END ); PLAYLIST_APPEND, PLAYLIST_END );
p_item->i_flags &= ~PLAYLIST_SKIP_FLAG;
p_item->i_flags &= ~PLAYLIST_SAVE_FLAG;
} }
} }
...@@ -225,16 +231,15 @@ static void browse_callback( ...@@ -225,16 +231,15 @@ static void browse_callback(
} }
else else
{ {
/** \todo Store the input id and search it, rather than searching the items */
playlist_item_t *p_item; playlist_item_t *p_item;
p_item = playlist_ChildSearchName( p_sys->p_node_cat, name );
p_item = playlist_ChildSearchName( p_sys->p_node, name );
if( p_item == NULL ) if( p_item == NULL )
{
msg_Err( p_sd, "failed to find service '%s' in playlist", name ); msg_Err( p_sd, "failed to find service '%s' in playlist", name );
}
else else
{ {
playlist_Delete( p_sys->p_playlist, p_item->input.i_id ); playlist_LockDeleteAllFromInput( p_sys->p_playlist,
p_item->p_input->i_id );
} }
} }
} }
...@@ -302,8 +307,8 @@ static int Open( vlc_object_t *p_this ) ...@@ -302,8 +307,8 @@ static int Open( vlc_object_t *p_this )
goto error; goto error;
} }
playlist_NodesCreateForSD( p_playlist, _("Bonjour"), &p_sys->p_node_cat, playlist_NodesCreateForSD( p_sys->p_playlist, _("Bonjour"),
&p_sys->p_node_one ); &p_sys->p_node_cat,&p_sys->p_node_one );
p_sd->pf_run = Run; p_sd->pf_run = Run;
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -335,7 +340,8 @@ static void Close( vlc_object_t *p_this ) ...@@ -335,7 +340,8 @@ static void Close( vlc_object_t *p_this )
avahi_client_free( p_sys->client ); avahi_client_free( p_sys->client );
avahi_simple_poll_free( p_sys->simple_poll ); avahi_simple_poll_free( p_sys->simple_poll );
playlist_NodeDelete( p_sys->p_playlist, p_sys->p_node, VLC_TRUE, VLC_TRUE ); playlist_NodeDelete( p_sys->p_playlist, p_sys->p_node_one, VLC_TRUE, VLC_TRUE );
playlist_NodeDelete( p_sys->p_playlist, p_sys->p_node_cat, VLC_TRUE, VLC_TRUE );
vlc_object_release( p_sys->p_playlist ); vlc_object_release( p_sys->p_playlist );
free( p_sys ); free( p_sys );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment