X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fservices_discovery%2Fupnp_intel.cpp;h=c1d67a95ccbd162c9e818badacb99d04ad42d735;hb=25b8641d713521fd4e0114b31b93516273845034;hp=10339116000af66d8ebd5b1f7928e800598f281e;hpb=81c5ac29fa2e80426c1b1dfcc941a1aabe8bc808;p=vlc diff --git a/modules/services_discovery/upnp_intel.cpp b/modules/services_discovery/upnp_intel.cpp index 1033911600..c1d67a95cc 100644 --- a/modules/services_discovery/upnp_intel.cpp +++ b/modules/services_discovery/upnp_intel.cpp @@ -27,6 +27,7 @@ /* \TODO: Debug messages: "__FILE__, __LINE__" ok ???, Wrn/Err ??? \TODO: Change names to VLC standard ??? + \TODO: Rewrite this using the new service discovery API (see sap.c, shout.c). */ @@ -37,9 +38,12 @@ #include #undef PACKAGE_NAME +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include #include -#include "vlc_strings.h" // VLC handle @@ -286,7 +290,7 @@ static int Open( vlc_object_t *p_this ) /* Create our playlist node */ playlist_NodesPairCreate( pl_Get( p_sd ), _("Devices"), &p_sys->p_node_cat, &p_sys->p_node_one, - VLC_TRUE ); + true ); return VLC_SUCCESS; } @@ -296,10 +300,10 @@ static void Close( vlc_object_t *p_this ) services_discovery_t *p_sd = ( services_discovery_t* )p_this; services_discovery_sys_t *p_sys = p_sd->p_sys; - playlist_NodeDelete( pl_Get( p_sd ), p_sys->p_node_one, VLC_TRUE, - VLC_TRUE ); - playlist_NodeDelete( pl_Get( p_sd ), p_sys->p_node_cat, VLC_TRUE, - VLC_TRUE ); + playlist_NodeDelete( pl_Get( p_sd ), p_sys->p_node_one, true, + true ); + playlist_NodeDelete( pl_Get( p_sd ), p_sys->p_node_cat, true, + true ); free( p_sys ); } @@ -393,8 +397,6 @@ IXML_Document* parseBrowseResult( IXML_Document* doc ) const char* resultString = ixmlNode_getNodeValue( textNode ); char* resultXML = strdup( resultString ); - resolve_xml_special_chars( resultXML ); - IXML_Document* browseDoc = ixmlParseBuffer( resultXML ); free( resultXML ); @@ -465,11 +467,11 @@ static int Callback( Upnp_EventType eventType, void* event, void* pCookie ) case UPNP_EVENT_SUBSCRIBE_COMPLETE: msg_Warn( cookie->serviceDiscovery, "subscription complete" ); break; - + case UPNP_DISCOVERY_SEARCH_TIMEOUT: msg_Warn( cookie->serviceDiscovery, "search timeout" ); break; - + default: msg_Dbg( cookie->serviceDiscovery, "%s:%d: DEBUG: UNHANDLED EVENT ( TYPE=%d )", __FILE__, __LINE__, eventType ); break; @@ -619,7 +621,7 @@ MediaServer::~MediaServer() if ( _contents ) { playlist_NodeDelete( pl_Get( _cookie->serviceDiscovery ) , - _playlistNode, VLC_TRUE, VLC_TRUE ); + _playlistNode, true, true ); } delete _contents; @@ -758,7 +760,7 @@ void MediaServer::fetchContents() if ( _contents ) { PL_LOCK; - playlist_NodeEmpty( p_playlist, _playlistNode, VLC_TRUE ); + playlist_NodeEmpty( p_playlist, _playlistNode, true ); PL_UNLOCK; delete _contents; } @@ -853,7 +855,7 @@ void MediaServer::_buildPlaylist( Container* parent ) playlist_item_t* parentNode = parent->getPlaylistNode(); char* title = strdup( container->getTitle() ); - playlist_item_t* node = playlist_NodeCreate( p_playlist, title, parentNode, 0 ); + playlist_item_t* node = playlist_NodeCreate( p_playlist, title, parentNode, 0, NULL ); free( title ); container->setPlaylistNode( node ); @@ -869,11 +871,13 @@ void MediaServer::_buildPlaylist( Container* parent ) item->getResource(), item->getTitle() ); int i_cat; + /* FIXME: playlist_AddInput() can fail */ playlist_BothAddInput( p_playlist, p_input, parentNode, PLAYLIST_APPEND, PLAYLIST_END, &i_cat, NULL, - VLC_FALSE ); + false ); + vlc_gc_decref( p_input ); /* TODO: do this better by storing ids */ - playlist_item_t *p_node = playlist_ItemGetById( p_playlist, i_cat, VLC_FALSE ); + playlist_item_t *p_node = playlist_ItemGetById( p_playlist, i_cat, false ); assert( p_node ); item->setPlaylistNode( p_node ); } @@ -916,7 +920,7 @@ bool MediaServerList::addServer( MediaServer* s ) char* name = strdup( s->getFriendlyName() ); playlist_item_t* node = playlist_NodeCreate( pl_Get( _cookie->serviceDiscovery ), name, - _cookie->serviceDiscovery->p_sys->p_node_cat, 0 ); + _cookie->serviceDiscovery->p_sys->p_node_cat, 0, NULL ); free( name ); s->setPlaylistNode( node );