[vlc-commits] [Git][videolan/vlc][3.0.x] upnp: fix browsing of certain servers

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sat Jan 15 07:04:03 UTC 2022



Felix Paul Kühne pushed to branch 3.0.x at VideoLAN / VLC


Commits:
584bf4f6 by Felix Paul Kühne at 2022-01-14T07:09:28+01: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

(cherry picked from commit 741f1f90cdb1f972d4552c4f45eafd24b3092621)

- - - - -


1 changed file:

- modules/services_discovery/upnp.cpp


Changes:

=====================================
modules/services_discovery/upnp.cpp
=====================================
@@ -874,13 +874,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/584bf4f6414daf73adba01fd10f7b0aafdc1330d

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




More information about the vlc-commits mailing list