From c8665bcf4057594688360f5884f95ea0d56271ea Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Tue, 22 Aug 2017 12:28:42 -0700 Subject: [PATCH] containers: Add Samsung DCM10 magic containers Some Samsung clients (at least UE40ES8000) apparently cannot handle our standard container IDs when we turn on the DCM10 feature. So they end up requesting an empty ObjectID, which is invalid. If we blindly return our root container, they still have problems browsing because they only use one object from our returned results, so they don't get a full list of browseable categories. It has been confirmed that we can work around this by using the same ObjectIDs that Samsung uses for our root containers in our X_GetFeatureList response (A, V, and I). And fortunately it's trivial to handle these renamed ObjectIDs using our magic container system. Fixes: SF Bug #311 (Samsung TV built-in DLNA client broken since v1.1.5) --- containers.c | 11 +++++++++-- upnpsoap.c | 6 ++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/containers.c b/containers.c index e1a9c57..f5cece1 100644 --- a/containers.c +++ b/containers.c @@ -32,8 +32,10 @@ const char *music_artist_id = MUSIC_ARTIST_ID; const char *music_album_id = MUSIC_ALBUM_ID; const char *music_plist_id = MUSIC_PLIST_ID; const char *music_dir_id = MUSIC_DIR_ID; +const char *video_id = VIDEO_ID; const char *video_all_id = VIDEO_ALL_ID; const char *video_dir_id = VIDEO_DIR_ID; +const char *image_id = IMAGE_ID; const char *image_all_id = IMAGE_ALL_ID; const char *image_date_id = IMAGE_DATE_ID; const char *image_camera_id = IMAGE_CAMERA_ID; @@ -111,6 +113,11 @@ struct magic_container_s magic_containers[] = { NULL, "16", &image_dir_id, NULL, NULL, NULL, NULL, NULL, NULL, -1, FLAG_MS_PFS }, { NULL, "D2", &image_camera_id, NULL, NULL, NULL, NULL, NULL, NULL, -1, FLAG_MS_PFS }, + /* Samsung DCM10 containers for Series E(?) */ + { NULL, "I", &image_id, NULL, NULL, NULL, NULL, NULL, NULL, -1, FLAG_SAMSUNG_DCM10 }, + { NULL, "A", &music_id, NULL, NULL, NULL, NULL, NULL, NULL, -1, FLAG_SAMSUNG_DCM10 }, + { NULL, "V", &video_id, NULL, NULL, NULL, NULL, NULL, NULL, -1, FLAG_SAMSUNG_DCM10 }, + /* Jump straight to Music on audio-only devices */ { NULL, "0", &music_id, NULL, "0", NULL, NULL, NULL, NULL, -1, FLAG_AUDIO_ONLY }, @@ -133,9 +140,9 @@ in_magic_container(const char *id, int flags, const char **real_id) len = strlen(magic_containers[i].objectid_match); if (strncmp(id, magic_containers[i].objectid_match, len) == 0) { - if (*(id+len) == '$') + if (*(id+len) == '$') *real_id = id+len+1; - else if (*(id+len) == '\0') + else if (*(id+len) == '\0') *real_id = id; else continue; diff --git a/upnpsoap.c b/upnpsoap.c index 61067e7..441da98 100644 --- a/upnpsoap.c +++ b/upnpsoap.c @@ -2081,6 +2081,12 @@ SamsungGetFeatureList(struct upnphttp * h, const char * action) image = runtime_vars.root_container; } } + else if (h->req_client && (h->req_client->type->flags & FLAG_SAMSUNG_DCM10)) + { + audio = "A"; + video = "V"; + image = "I"; + } len = snprintf(body, sizeof(body), resp, audio, video, image);