From c1bb37a38754e0fed6a55a2ebf204c68c3d2135b Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Fri, 10 Apr 2015 15:33:09 -0700 Subject: [PATCH] clients: Re-enable Samsung DCM10 flag. The browsing issue that was reported on Samsung Series F was actually only present when a custom root container was being specified (http://sourceforge.net/p/minidlna/patches/121/). So instead of disabling DCM10, fix our X_GetFeatureList response when a custom root container is set. If the custom root is Browse Folders, then drop the user straight to folder browsing for that media type. If it's something other than folder browsing, just set all media type roots to the custom root container. For future reference, the DCM10 flag enables (at least) video bookmark support and Samsung "BasicView" support; so selecting, for example, Videos from the Samsung UI can send you straight to the Videos section of the media library. --- clients.c | 2 +- upnpsoap.c | 31 +++++++++++++++++++++++++------ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/clients.c b/clients.c index 8d82ba2..a8609d2 100644 --- a/clients.c +++ b/clients.c @@ -66,7 +66,7 @@ struct client_type_s client_types[] = /* User-Agent: DLNADOC/1.50 SEC_HHP_[TV]UE40D7000/1.0 */ /* User-Agent: DLNADOC/1.50 SEC_HHP_ Family TV/1.0 */ { ESamsungSeriesCDE, - FLAG_SAMSUNG | FLAG_DLNA | FLAG_NO_RESIZE, + FLAG_SAMSUNG | FLAG_DLNA | FLAG_NO_RESIZE | FLAG_SAMSUNG_DCM10, "Samsung Series [CDEF]", "SEC_HHP_", EUserAgent diff --git a/upnpsoap.c b/upnpsoap.c index cc76c4c..0a71863 100644 --- a/upnpsoap.c +++ b/upnpsoap.c @@ -1818,22 +1818,41 @@ SamsungGetFeatureList(struct upnphttp * h, const char * action) static const char resp[] = "" "" - "\r\n" "<Features xmlns=\"urn:schemas-upnp-org:av:avs\"" " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" " xsi:schemaLocation=\"urn:schemas-upnp-org:av:avs http://www.upnp.org/schemas/av/avs.xsd\">" "<Feature name=\"samsung.com_BASICVIEW\" version=\"1\">" - "<container id=\"" MUSIC_ID "\" type=\"object.item.audioItem\"/>" - "<container id=\"" VIDEO_ID "\" type=\"object.item.videoItem\"/>" - "<container id=\"" IMAGE_ID "\" type=\"object.item.imageItem\"/>" + "<container id=\"%s\" type=\"object.item.audioItem\"/>" + "<container id=\"%s\" type=\"object.item.videoItem\"/>" + "<container id=\"%s\" type=\"object.item.imageItem\"/>" "</Feature>" "</Features>" ""; + const char *audio = MUSIC_ID; + const char *video = VIDEO_ID; + const char *image = IMAGE_ID; + char body[1024]; + int len; if (runtime_vars.root_container) - return SoapError(h, 401, "Invalid Action"); + { + if (strcmp(runtime_vars.root_container, BROWSEDIR_ID) == 0) + { + audio = MUSIC_DIR_ID; + video = VIDEO_DIR_ID; + image = IMAGE_DIR_ID; + } + else + { + audio = runtime_vars.root_container; + video = runtime_vars.root_container; + image = runtime_vars.root_container; + } + } - BuildSendAndCloseSoapResp(h, resp, sizeof(resp)-1); + len = snprintf(body, sizeof(body), resp, audio, video, image); + + BuildSendAndCloseSoapResp(h, body, len); } static void