minidlna: update to latest master

Removed inactive maintainer.

Cleaned up Makefile to remove old options.

Switched to PKG_INSTALL for consistency.

Added PKG_BUILD_PARALLEL for faster compilation.

Fixed license info.

Removed '' from enabled for consistency.

Ran init script through shellcheck. Batched config file writes.

Switched it to use procd. The -S parameter changes it to foreground. It
stands for systemd.

Added a sysctl tweak to get rid of warning.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2020-01-12 19:05:26 -08:00
parent 5b22f3f59c
commit e9a65f1380
11 changed files with 218 additions and 66 deletions
+24
View File
@@ -0,0 +1,24 @@
From eb473817d73b8740f27955f93950029fdfc9d73e Mon Sep 17 00:00:00 2001
From: Daniel Kamil Kozar <dkk089@gmail.com>
Date: Sat, 15 Dec 2018 00:55:20 +0100
Subject: [PATCH] LG webOS 3.5 devices require audio/flac in order to detect
FLAC
Imported from https://sourceforge.net/p/minidlna/patches/176/
---
clients.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clients.c b/clients.c
index 42f0d1c..d324eab 100644
--- a/clients.c
+++ b/clients.c
@@ -164,7 +164,7 @@ struct client_type_s client_types[] =
/* USER-AGENT: Linux/2.6.35 UPnP/1.0 DLNADOC/1.50 INTEL_NMPR/2.0 LGE_DLNA_SDK/1.6.0 */
{ ELGNetCastDevice,
- FLAG_DLNA | FLAG_CAPTION_RES,
+ FLAG_DLNA | FLAG_CAPTION_RES | FLAG_MIME_FLAC_FLAC,
"LG",
"LGE_DLNA_SDK/1.6.0",
EUserAgent
@@ -9,6 +9,8 @@ Subject: [PATCH] Wrap container definitions into a structure
scanner.c | 33 ++++++---------------------------
3 files changed, 39 insertions(+), 27 deletions(-)
diff --git a/containers.c b/containers.c
index f5cece1..19a0bb1 100644
--- a/containers.c
+++ b/containers.c
@@ -23,6 +23,31 @@
@@ -42,7 +44,9 @@ Subject: [PATCH] Wrap container definitions into a structure
+
#define NINETY_DAYS "7776000"
static const char *music_id = MUSIC_ID;
const char *music_id = MUSIC_ID;
diff --git a/containers.h b/containers.h
index aef77c5..1fcf7cd 100644
--- a/containers.h
+++ b/containers.h
@@ -16,6 +16,14 @@
@@ -60,9 +64,11 @@ Subject: [PATCH] Wrap container definitions into a structure
struct magic_container_s {
const char *name;
const char *objectid_match;
diff --git a/scanner.c b/scanner.c
index a730567..eb26c9e 100644
--- a/scanner.c
+++ b/scanner.c
@@ -529,30 +529,7 @@ insert_file(const char *name, const char
@@ -529,30 +529,7 @@ insert_file(const char *name, const char *path, const char *parentID, int object
int
CreateDatabase(void)
{
@@ -114,5 +120,5 @@ Subject: [PATCH] Wrap container definitions into a structure
- for( i=0; magic_containers[i].objectid_match; i++ )
+ for( int i=0; magic_containers[i].objectid_match; i++ )
{
const struct magic_container_s *magic = &magic_containers[i];
struct magic_container_s *magic = &magic_containers[i];
if (!magic->name)
@@ -12,7 +12,7 @@ Subject: [PATCH] Mark all instances of magic_container_s as const
--- a/containers.c
+++ b/containers.c
@@ -25,23 +25,23 @@
@@ -50,23 +50,23 @@
#define NINETY_DAYS "7776000"
@@ -52,7 +52,7 @@ Subject: [PATCH] Mark all instances of magic_container_s as const
{
/* Alternate root container */
{ NULL,
@@ -124,7 +124,7 @@ struct magic_container_s magic_container
@@ -149,7 +149,7 @@ struct magic_container_s magic_container
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0 }
};
@@ -61,7 +61,7 @@ Subject: [PATCH] Mark all instances of magic_container_s as const
in_magic_container(const char *id, int flags, const char **real_id)
{
size_t len;
@@ -154,7 +154,7 @@ in_magic_container(const char *id, int f
@@ -179,7 +179,7 @@ in_magic_container(const char *id, int f
return NULL;
}
@@ -72,7 +72,7 @@ Subject: [PATCH] Mark all instances of magic_container_s as const
int i;
--- a/containers.h
+++ b/containers.h
@@ -30,7 +30,7 @@ struct magic_container_s {
@@ -38,7 +38,7 @@ struct magic_container_s {
int required_flags;
};
@@ -85,9 +85,9 @@ Subject: [PATCH] Mark all instances of magic_container_s as const
+const struct magic_container_s *check_magic_container(const char *id, int flags);
--- a/scanner.c
+++ b/scanner.c
@@ -587,7 +587,7 @@ CreateDatabase(void)
@@ -566,7 +566,7 @@ CreateDatabase(void)
}
for( i=0; magic_containers[i].objectid_match; i++ )
for( int i=0; magic_containers[i].objectid_match; i++ )
{
- struct magic_container_s *magic = &magic_containers[i];
+ const struct magic_container_s *magic = &magic_containers[i];
@@ -105,7 +105,7 @@ Subject: [PATCH] Mark all instances of magic_container_s as const
{
int ret;
@@ -1292,7 +1292,7 @@ BrowseContentDirectory(struct upnphttp *
@@ -1297,7 +1297,7 @@ BrowseContentDirectory(struct upnphttp *
"<Result>"
"&lt;DIDL-Lite"
CONTENT_DIRECTORY_SCHEMAS;
@@ -114,7 +114,7 @@ Subject: [PATCH] Mark all instances of magic_container_s as const
char *zErrMsg = NULL;
char *sql, *ptr;
struct Response args;
@@ -1807,7 +1807,7 @@ SearchContentDirectory(struct upnphttp *
@@ -1819,7 +1819,7 @@ SearchContentDirectory(struct upnphttp *
"<Result>"
"&lt;DIDL-Lite"
CONTENT_DIRECTORY_SCHEMAS;
@@ -0,0 +1,27 @@
From 972fb2bbfdb7118551da45c5828c9e74be581fc4 Mon Sep 17 00:00:00 2001
From: Daniel Kamil Kozar <dkk089@gmail.com>
Date: Sat, 15 Dec 2018 21:55:52 +0100
Subject: [PATCH] What about David Bowie's "Heroes"?
---
utils.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/utils.c b/utils.c
index dc936f9..dfa2b65 100644
--- a/utils.c
+++ b/utils.c
@@ -87,13 +87,6 @@ trim(char *str)
len--;
}
- if (str[0] == '"' && str[len-1] == '"')
- {
- str[0] = '\0';
- str[len-1] = '\0';
- str++;
- }
-
return str;
}
@@ -0,0 +1,80 @@
From aae49f0f80e73d1b52f23b89b0d314e9b9f89425 Mon Sep 17 00:00:00 2001
From: Daniel Kamil Kozar <dkk089@gmail.com>
Date: Sat, 15 Dec 2018 22:55:44 +0100
Subject: [PATCH] Add an option to disable cover art resizing
Imported from
https://sourceforge.net/p/minidlna/patches/_discuss/thread/9825a1a0/4c28/attachment/minidlna-1.1.2-no-cover-resize.patch
---
albumart.c | 3 +++
minidlna.c | 4 ++++
options.c | 1 +
options.h | 1 +
upnpglobalvars.h | 1 +
5 files changed, 10 insertions(+)
diff --git a/albumart.c b/albumart.c
index de026ec..04fa8f2 100644
--- a/albumart.c
+++ b/albumart.c
@@ -67,6 +67,9 @@ save_resized_album_art(image_s *imsrc, const char *path)
strncpyt(cache_dir, cache_file, sizeof(cache_dir));
make_dir(dirname(cache_dir), S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);
+ if( GETFLAG(NO_COVER_RESIZE_MASK) )
+ return image_save_to_jpeg_file(imsrc, cache_file);
+
if( imsrc->width > imsrc->height )
{
dstw = 160;
diff --git a/minidlna.c b/minidlna.c
index 7cce301..a1dd08b 100644
--- a/minidlna.c
+++ b/minidlna.c
@@ -735,6 +735,10 @@ init(int argc, char **argv)
if (strtobool(ary_options[i].value))
SETFLAG(DLNA_STRICT_MASK);
break;
+ case RESIZE_COVER_ART:
+ if((strcmp(ary_options[i].value, "no") == 0) || !atoi(ary_options[i].value))
+ SETFLAG(NO_COVER_RESIZE_MASK);
+ break;
case ROOT_CONTAINER:
switch (ary_options[i].value[0]) {
case '.':
diff --git a/options.c b/options.c
index cee3dff..cacbdfb 100644
--- a/options.c
+++ b/options.c
@@ -68,6 +68,7 @@ static const struct {
{ WIDE_LINKS, "wide_links" },
{ TIVO_DISCOVERY, "tivo_discovery" },
{ ENABLE_SUBTITLES, "enable_subtitles" },
+ { RESIZE_COVER_ART, "resize_covers" },
};
int
diff --git a/options.h b/options.h
index 1ff5b22..ec5ea68 100644
--- a/options.h
+++ b/options.h
@@ -61,6 +61,7 @@ enum upnpconfigoptions {
WIDE_LINKS, /* allow following symlinks outside the defined media_dirs */
TIVO_DISCOVERY, /* TiVo discovery protocol: bonjour or beacon. Defaults to bonjour if supported */
ENABLE_SUBTITLES, /* Enable generic subtitle support for all clients by default */
+ RESIZE_COVER_ART, /* resize cover art to comply with DLNA spec */
};
/* readoptionsfile()
diff --git a/upnpglobalvars.h b/upnpglobalvars.h
index 1a2fb5e..7e3a1ba 100644
--- a/upnpglobalvars.h
+++ b/upnpglobalvars.h
@@ -205,6 +205,7 @@ extern uint32_t runtime_flags;
#define RESCAN_MASK 0x0200
#define SUBTITLES_MASK 0x0400
#define FORCE_ALPHASORT_MASK 0x0800
+#define NO_COVER_RESIZE_MASK 0x1000
#define SETFLAG(mask) runtime_flags |= mask
#define GETFLAG(mask) (runtime_flags & mask)
@@ -0,0 +1,21 @@
From ce34745bb19a649c8570ef0a3da9ffd5e941548e Mon Sep 17 00:00:00 2001
From: Daniel Kamil Kozar <dkk089@gmail.com>
Date: Sun, 30 Dec 2018 22:49:50 +0100
Subject: [PATCH] No return in a function returning non-void
---
upnpdescgen.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/upnpdescgen.c b/upnpdescgen.c
index 85ce185..78d5754 100644
--- a/upnpdescgen.c
+++ b/upnpdescgen.c
@@ -525,6 +525,7 @@ genXML(char *str, int *len, int *tmplen, const struct XMLElt *p)
pile[top].eltname = eltname;
}
}
+ return str;
}
/* genRootDesc() :