Browse Source

Merge pull request #11004 from neheb/dln

minidlna: update to latest master
lilik-openwrt-22.03
Rosen Penev 5 years ago
committed by GitHub
parent
commit
552c9ec87a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 219 additions and 67 deletions
  1. +13
    -27
      multimedia/minidlna/Makefile
  2. +1
    -2
      multimedia/minidlna/files/minidlna.config
  3. +34
    -27
      multimedia/minidlna/files/minidlna.init
  4. +2
    -0
      multimedia/minidlna/files/minidlna.sysctl
  5. +24
    -0
      multimedia/minidlna/patches/010-lg.patch
  6. +9
    -3
      multimedia/minidlna/patches/020-wrap_container_definitions_into_a_structure.patch
  7. +8
    -8
      multimedia/minidlna/patches/030-mark_all_instances_of_magic_container_s_as_const.patch
  8. +27
    -0
      multimedia/minidlna/patches/040-heroes.patch
  9. +80
    -0
      multimedia/minidlna/patches/050-no-cover-resizing.patch
  10. +0
    -0
      multimedia/minidlna/patches/060-reduce_duplication_in_sql_c.patch
  11. +21
    -0
      multimedia/minidlna/patches/070-return-void.patch

+ 13
- 27
multimedia/minidlna/Makefile View File

@ -12,18 +12,17 @@ PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://git.code.sf.net/p/minidlna/git
PKG_SOURCE_DATE:=2018-04-10
PKG_SOURCE_VERSION:=799e6cf505ec470b2bf0ae4118143380aa16b837
PKG_MIRROR_HASH:=67cc817e671de99e5a3f5ed237f89e22470f1de94819bcaba86c0ba821104af5
PKG_SOURCE_DATE:=2019-12-09
PKG_SOURCE_VERSION:=0763719f2776f91114bc5564919896f28e078c77
PKG_MIRROR_HASH:=93030a80eff44c0ec13f54daf3b2ba345b70ef8645e0343a34092f37d6f9e8dd
PKG_LICENSE:=GPL-2.0 BSD-3-Clause
PKG_MAINTAINER:=
PKG_LICENSE:=GPL-2.0-or-later BSD-3-Clause
PKG_LICENSE_FILES:=COPYING LICENCE.miniupnpd
PKG_MAINTAINER:=Knyazkov Dmitry <medavedik@gmail.com>
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=0
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=util-linux
include $(INCLUDE_DIR)/package.mk
@ -49,37 +48,24 @@ define Package/minidlna/conffiles
/etc/config/minidlna
endef
TARGET_CPPFLAGS += \
-I$(ICONV_PREFIX)/include \
-I$(INTL_PREFIX)/include \
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \
TARGET_LDFLAGS += \
-L$(ICONV_PREFIX)/lib \
-L$(INTL_PREFIX)/lib \
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
MAKE_FLAGS +=\
CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
ICONV_LIBS="-liconv $(if $(INTL_FULL),-lintl)" \
CONFIGURE_ARGS +=\
--with-libiconv-prefix="$(ICONV_PREFIX)" \
--with-libintl-prefix="$(INTL_PREFIX)" \
--with-os-name="OpenWrt Linux" \
--with-os-version="$(LINUX_VERSION)" \
--with-os-url="http://openwrt.org/" \
--with-os-url="https://openwrt.org/" \
--with-db-path="/var/run/minidlna" \
--with-log-path="/var/log" \
--with-log-path="/var/log"
define Package/minidlna/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/minidlnad $(1)/usr/bin/minidlna
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/minidlnad $(1)/usr/sbin/minidlnad
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/minidlna.init $(1)/etc/init.d/minidlna
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/minidlna.config $(1)/etc/config/minidlna
$(INSTALL_DIR) $(1)/etc/sysctl.d
$(INSTALL_CONF) ./files/minidlna.sysctl $(1)/etc/sysctl.d/30-minidlna.conf
endef
$(eval $(call BuildPackage,minidlna))

+ 1
- 2
multimedia/minidlna/files/minidlna.config View File

@ -1,11 +1,10 @@
config minidlna config
option 'enabled' '0'
option enabled '0'
option user 'minidlna'
option port '8200'
option interface 'br-lan'
option friendly_name 'OpenWrt DLNA Server'
option db_dir '/var/run/minidlna'
option log_dir '/var/log/minidlna'
option inotify '1'
option enable_tivo '0'
option wide_links '0'


+ 34
- 27
multimedia/minidlna/files/minidlna.init View File

@ -1,17 +1,13 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2010 OpenWrt.org
START=50
START=81
SERVICE_USE_PID=1
SERVICE_PID_FILE=/var/run/minidlna/minidlna.pid
PROG=/usr/sbin/minidlnad
USE_PROCD=1
MINIDLNA_CONFIG_FILE="/var/etc/minidlna.conf"
minidlna_cfg_append() {
echo "$1" >> "$MINIDLNA_CONFIG_FILE"
}
minidlna_cfg_addbool() {
local cfg="$1"
local key="$2"
@ -20,7 +16,7 @@ minidlna_cfg_addbool() {
config_get_bool val "$cfg" "$key" "$def"
[ "$val" -gt 0 ] && val="yes" || val="no"
minidlna_cfg_append "$key=$val"
echo "$key=$val"
}
minidlna_cfg_addstr() {
@ -30,12 +26,12 @@ minidlna_cfg_addstr() {
local val
config_get val "$cfg" "$key" "$def"
[ -n "$val" ] && minidlna_cfg_append "$key=$val"
[ -n "$val" ] && echo "$key=$val"
}
minidlna_cfg_add_media_dir() {
local val=$1
minidlna_cfg_append "media_dir=$val"
echo "media_dir=$val"
}
minidlna_create_config() {
@ -46,18 +42,18 @@ minidlna_create_config() {
config_get port "$cfg" port
config_get interface "$cfg" interface
[ -z "$interface" -o -t "$port" ] && return 1
{ [ -z "$interface" ] || [ -t "$port" ]; } && return 1
mkdir -p /var/etc
echo "# this file is generated automatically, don't edit" > "$MINIDLNA_CONFIG_FILE"
{
echo "# this file is generated automatically, don't edit"
minidlna_cfg_append "port=$port"
minidlna_cfg_append "network_interface=$interface"
echo "port=$port"
echo "network_interface=$interface"
minidlna_cfg_addstr "$cfg" friendly_name
minidlna_cfg_addstr "$cfg" user
minidlna_cfg_addstr "$cfg" db_dir
minidlna_cfg_addstr "$cfg" log_dir
minidlna_cfg_addstr "$cfg" log_level 'error'
minidlna_cfg_addbool "$cfg" inotify '1'
minidlna_cfg_addbool "$cfg" enable_tivo '0'
@ -72,16 +68,16 @@ minidlna_create_config() {
minidlna_cfg_addstr "$cfg" root_container '.'
minidlna_cfg_addstr "$cfg" uuid '019f9a56-ff60-44c0-9edc-eae88d09fa05'
config_list_foreach "$cfg" "media_dir" minidlna_cfg_add_media_dir
} > "$MINIDLNA_CONFIG_FILE"
return 0
}
start() {
start_service() {
local enabled
local db_dir
local log_dir
local user
local var
local val
config_load 'minidlna'
config_get_bool enabled config 'enabled' '0'
@ -89,20 +85,31 @@ start() {
[ "$enabled" -gt 0 ] || return 1
config_get val "config" uuid
[ "$val" = '' ] && uci set minidlna.config.uuid=$(cat /proc/sys/kernel/random/uuid) && uci commit
[ "$val" = '' ] && uci set minidlna.config.uuid="$(cat /proc/sys/kernel/random/uuid)" && uci commit
minidlna_create_config config || return 1
config_get db_dir config 'db_dir' '/var/run/minidlna'
config_get log_dir config 'log_dir' '/var/log/minidlna'
config_get user config 'user' 'root'
mkdir -m 0755 -p "$db_dir" "$log_dir"
chown -R "$user" "$db_dir" "$log_dir"
config_get user config 'user' 'minidlna'
[ -d "$db_dir" ] || {
mkdir -m 755 -p "$db_dir"
chown -R "$user":"$user" "$db_dir"
}
procd_open_instance
procd_set_param command "$PROG"
procd_append_param command -S -f "$MINIDLNA_CONFIG_FILE"
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param respawn
procd_close_instance
}
service_start /usr/bin/minidlna -f "$MINIDLNA_CONFIG_FILE"
reload_service() {
procd_send_signal "$PROG"
}
stop() {
service_stop /usr/bin/minidlna
service_triggers() {
procd_add_reload_trigger "minidlna"
}

+ 2
- 0
multimedia/minidlna/files/minidlna.sysctl View File

@ -0,0 +1,2 @@
# this is the desired value for minidlna
fs.inotify.max_user_watches=65536

+ 24
- 0
multimedia/minidlna/patches/010-lg.patch 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

multimedia/minidlna/patches/003-wrap_container_definitions_into_a_structure.patch → multimedia/minidlna/patches/020-wrap_container_definitions_into_a_structure.patch View File


multimedia/minidlna/patches/002-mark_all_instances_of_magic_container_s_as_const.patch → multimedia/minidlna/patches/030-mark_all_instances_of_magic_container_s_as_const.patch View File


+ 27
- 0
multimedia/minidlna/patches/040-heroes.patch View File

@ -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;
}

+ 80
- 0
multimedia/minidlna/patches/050-no-cover-resizing.patch View File

@ -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)

multimedia/minidlna/patches/004-reduce_duplication_in_sql_c.patch → multimedia/minidlna/patches/060-reduce_duplication_in_sql_c.patch View File


+ 21
- 0
multimedia/minidlna/patches/070-return-void.patch View File

@ -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() :

Loading…
Cancel
Save