002-1.2.0-0014-clients-Add-media-extension-to-titles-for-Hyundai-TV.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. From 5450ac486e9956f5139c5d5074ce09c49f4b6a9a Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Jind=C5=99ich=20Makovi=C4=8Dka?= <makovick@gmail.com>
  3. Date: Tue, 2 May 2017 20:08:30 +0200
  4. Subject: [PATCH] clients: Add media extension to titles for Hyundai TVs
  5. On Hyundai HLN 24TS382 Smart TV, the DLNA client refuses to display
  6. media files whose title does not end with a media file extension.
  7. Because minidlna strips the extensions, all folders thus appear empty.
  8. This patch adds a quirk for Hyundai TVs that appends the original file
  9. extension to the titles, which fixes the issue.
  10. ---
  11. clients.c | 7 +++++++
  12. clients.h | 1 +
  13. upnpsoap.c | 10 ++++++++++
  14. 3 files changed, 18 insertions(+)
  15. diff --git a/clients.c b/clients.c
  16. index e045ad8..c3bd96d 100644
  17. --- a/clients.c
  18. +++ b/clients.c
  19. @@ -205,6 +205,13 @@ struct client_type_s client_types[] =
  20. EUserAgent
  21. },
  22. + { EHyundaiTV,
  23. + FLAG_DLNA,
  24. + "Hyundai TV",
  25. + "HYUNDAITV",
  26. + EFriendlyName
  27. + },
  28. +
  29. { ERokuSoundBridge,
  30. FLAG_MS_PFS | FLAG_AUDIO_ONLY | FLAG_MIME_WAV_WAV | FLAG_FORCE_SORT,
  31. "Roku SoundBridge",
  32. diff --git a/clients.h b/clients.h
  33. index f9818f5..fa39656 100644
  34. --- a/clients.h
  35. +++ b/clients.h
  36. @@ -75,6 +75,7 @@ enum client_types {
  37. ESonyBravia,
  38. ESonyInternetTV,
  39. EToshibaTV,
  40. + EHyundaiTV,
  41. EAsusOPlay,
  42. EBubbleUPnP,
  43. ENetFrontLivingConnect,
  44. diff --git a/upnpsoap.c b/upnpsoap.c
  45. index 9ee0b90..23473b7 100644
  46. --- a/upnpsoap.c
  47. +++ b/upnpsoap.c
  48. @@ -883,6 +883,16 @@ callback(void *args, int argc, char **argv, char **azColName)
  49. if( strlen(title) > 23 )
  50. title[23] = '\0';
  51. }
  52. + /* Hyundai hack: Only titles with a media extension get recognized. */
  53. + else if( passed_args->client == EHyundaiTV )
  54. + {
  55. + ext = mime_to_ext(mime);
  56. + ret = asprintf(&alt_title, "%s.%s", title, ext);
  57. + if( ret > 0 )
  58. + title = alt_title;
  59. + else
  60. + alt_title = NULL;
  61. + }
  62. }
  63. else if( *mime == 'a' )
  64. {
  65. --
  66. 2.11.0