[vlc-commits] UPNP: When removing server, also remove it from SD listings
Konstantin Pavlov
git at videolan.org
Tue Apr 19 15:18:58 CEST 2011
vlc | branch: master | Konstantin Pavlov <thresh at videolan.org> | Tue Apr 19 17:02:31 2011 +0400| [76b349a3d847c999ac6536b6c9b9de0c2987e83e] | committer: Konstantin Pavlov
UPNP: When removing server, also remove it from SD listings
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=76b349a3d847c999ac6536b6c9b9de0c2987e83e
---
modules/services_discovery/upnp.cpp | 7 +++++++
modules/services_discovery/upnp.hpp | 1 +
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index 2ade5be..dbeca7e 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -856,6 +856,11 @@ void MediaServer::setInputItem( input_item_t* p_input_item )
_p_input_item = p_input_item;
}
+input_item_t* MediaServer::getInputItem() const
+{
+ return _p_input_item;
+}
+
bool MediaServer::compareSID( const char* psz_sid )
{
return ( strncmp( _subscription_id, psz_sid, sizeof( Upnp_SID ) ) == 0 );
@@ -934,6 +939,8 @@ void MediaServerList::removeServer( const char* psz_udn )
msg_Dbg( _p_sd, "Removing server '%s'", p_server->getFriendlyName() );
+ services_discovery_RemoveItem( _p_sd, p_server->getInputItem() );
+
std::vector<MediaServer*>::iterator it;
for ( it = _list.begin(); it != _list.end(); ++it )
{
diff --git a/modules/services_discovery/upnp.hpp b/modules/services_discovery/upnp.hpp
index 70038a3..b3a3f47 100644
--- a/modules/services_discovery/upnp.hpp
+++ b/modules/services_discovery/upnp.hpp
@@ -63,6 +63,7 @@ public:
void fetchContents();
void setInputItem( input_item_t* p_input_item );
+ input_item_t* getInputItem() const;
bool compareSID( const char* psz_sid );
More information about the vlc-commits
mailing list