vlc/vlc-1.2 | branch: master | Chris Clayton <[email protected]> | Sat Dec 17 23:30:08 2011 +0000| [52201454118dc1e2b5f2c34c8ca1915f2518485f] | committer: Jean-Baptiste Kempf
upnp: Support UPnP A/V MediaServer:2 devices * Accept any version of the MediaServer service * Browse the advertised ContentDirectory service version Signed-off-by: Mirsal Ennaime <[email protected]> (cherry picked from commit 02f60487e26191b02b8d33c50323f5c1c1fffc4b) Signed-off-by: Jean-Baptiste Kempf <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=52201454118dc1e2b5f2c34c8ca1915f2518485f --- modules/services_discovery/upnp.cpp | 15 ++++++++++++--- modules/services_discovery/upnp.hpp | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp index 74452c2..cc770d9 100644 --- a/modules/services_discovery/upnp.cpp +++ b/modules/services_discovery/upnp.cpp @@ -380,7 +380,8 @@ void MediaServer::parseDeviceDescription( IXML_Document* p_doc, continue; } - if ( strcmp( MEDIA_SERVER_DEVICE_TYPE, psz_device_type ) != 0 ) + if ( strncmp( MEDIA_SERVER_DEVICE_TYPE, psz_device_type, + strlen( MEDIA_SERVER_DEVICE_TYPE ) - 1 ) != 0 ) continue; const char* psz_udn = xml_getChildElementValue( p_device_element, "UDN" ); @@ -437,10 +438,14 @@ void MediaServer::parseDeviceDescription( IXML_Document* p_doc, continue; } - if ( strcmp( CONTENT_DIRECTORY_SERVICE_TYPE, - psz_service_type ) != 0 ) + int k = strlen( CONTENT_DIRECTORY_SERVICE_TYPE ) - 1; + if ( strncmp( CONTENT_DIRECTORY_SERVICE_TYPE, + psz_service_type, k ) != 0 ) continue; + p_server->_i_content_directory_service_version = + psz_service_type[k]; + const char* psz_event_sub_url = xml_getChildElementValue( p_service_element, "eventSubURL" ); @@ -509,6 +514,7 @@ MediaServer::MediaServer( const char* psz_udn, _p_contents = NULL; _p_input_item = NULL; + _i_content_directory_service_version = 1; } MediaServer::~MediaServer() @@ -597,6 +603,9 @@ IXML_Document* MediaServer::_browseAction( const char* psz_object_id_, char* psz_service_type = strdup( CONTENT_DIRECTORY_SERVICE_TYPE ); + psz_service_type[strlen( psz_service_type ) - 1] = + _i_content_directory_service_version; + int i_res; i_res = UpnpAddToAction( &p_action, "Browse", diff --git a/modules/services_discovery/upnp.hpp b/modules/services_discovery/upnp.hpp index 4778216..ee41181 100644 --- a/modules/services_discovery/upnp.hpp +++ b/modules/services_discovery/upnp.hpp @@ -87,6 +87,7 @@ private: std::string _content_directory_control_url; int _i_subscription_timeout; + int _i_content_directory_service_version; Upnp_SID _subscription_id; }; _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
