[vlc-commits] [Git][videolan/vlc][master] upnp: fix browsing of certain servers

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Thu Jan 13 20:15:26 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
741f1f90 by Felix Paul Kühne at 2022-01-13T19:46:20+00:00
upnp: fix browsing of certain servers

This is a partial revert of 785c6dfe. Some servers (notably PLEX, UMS,
and some TV sets) amend the exposed media type with additional subtypes
for further differentiation not relevant to VLC, so it is actually
correct to compare the beginning of the string only.

For instance "object.container" can turn into
"object.container.storageFolder" or "object.container.person.musicArtist"
so the plain strcmp will fail to recognize the container nature.

Fixes vlc-ios#1239

- - - - -


1 changed file:

- modules/services_discovery/upnp.cpp


Changes:

=====================================
modules/services_discovery/upnp.cpp
=====================================
@@ -909,13 +909,13 @@ namespace
             psz_album_artist = xml_getChildElementValue( itemElement, "upnp:albumArtist" );
             psz_albumArt = xml_getChildElementValue( itemElement, "upnp:albumArtURI" );
             const char *psz_media_type = xml_getChildElementValue( itemElement, "upnp:class" );
-            if (strcmp(psz_media_type, "object.item.videoItem") == 0)
+            if (strncmp(psz_media_type, "object.item.videoItem", 21) == 0)
                 media_type = VIDEO;
-            else if (strcmp(psz_media_type, "object.item.audioItem") == 0)
+            else if (strncmp(psz_media_type, "object.item.audioItem", 21) == 0)
                 media_type = AUDIO;
-            else if (strcmp(psz_media_type, "object.item.imageItem") == 0)
+            else if (strncmp(psz_media_type, "object.item.imageItem", 21) == 0)
                 media_type = IMAGE;
-            else if (strcmp(psz_media_type, "object.container") == 0)
+            else if (strncmp(psz_media_type, "object.container", 16 ) == 0)
                 media_type = CONTAINER;
             else
                 return false;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/741f1f90cdb1f972d4552c4f45eafd24b3092621

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/741f1f90cdb1f972d4552c4f45eafd24b3092621
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list