aboutsummaryrefslogtreecommitdiff
path: root/net/minidlna/files
diff options
context:
space:
mode:
authorWilliam Grzybowski <wg@FreeBSD.org>2013-06-09 20:10:54 +0000
committerWilliam Grzybowski <wg@FreeBSD.org>2013-06-09 20:10:54 +0000
commita0d792bcd2cdb5132519b70ffa0541e4e4cfdb54 (patch)
tree57a1efe7116d65117ed2de16a2544ae10fe550b1 /net/minidlna/files
parent86a309115d7f85e5ab6c0667a3b89067aabf1101 (diff)
downloadports-a0d792bcd2cdb5132519b70ffa0541e4e4cfdb54.tar.gz
ports-a0d792bcd2cdb5132519b70ffa0541e4e4cfdb54.zip
Notes
Diffstat (limited to 'net/minidlna/files')
-rw-r--r--net/minidlna/files/BSDmakefile37
-rw-r--r--net/minidlna/files/config.h.in34
-rw-r--r--net/minidlna/files/getifaddr.c246
-rw-r--r--net/minidlna/files/minidlna.in11
-rw-r--r--net/minidlna/files/patch-aa141
-rw-r--r--net/minidlna/files/patch-ab9
-rw-r--r--net/minidlna/files/patch-clang-inline137
-rw-r--r--net/minidlna/files/patch-clients.h12
-rw-r--r--net/minidlna/files/patch-conf13
-rw-r--r--net/minidlna/files/patch-getifaddr.c13
-rw-r--r--net/minidlna/files/patch-inline23
-rw-r--r--net/minidlna/files/patch-lg19
-rw-r--r--net/minidlna/files/patch-minidlna.c89
-rw-r--r--net/minidlna/files/patch-minidlna.conf13
-rw-r--r--net/minidlna/files/patch-other-subnets25
-rw-r--r--net/minidlna/files/patch-replace-glob316
-rw-r--r--net/minidlna/files/patch-type-mismatch52
-rw-r--r--net/minidlna/files/patch-upnphttp60
-rw-r--r--net/minidlna/files/patch-utils.c-mpo (renamed from net/minidlna/files/patch-utils-mpo)7
-rw-r--r--net/minidlna/files/patch-warnings850
-rw-r--r--net/minidlna/files/scandir-patch26
21 files changed, 182 insertions, 1651 deletions
diff --git a/net/minidlna/files/BSDmakefile b/net/minidlna/files/BSDmakefile
deleted file mode 100644
index 224d1310ad70..000000000000
--- a/net/minidlna/files/BSDmakefile
+++ /dev/null
@@ -1,37 +0,0 @@
-PROG= minidlna
-NO_MAN= Ha-ha...
-
-OS!= uname
-VERS!= uname -r
-
-CFLAGS= -I${.CURDIR} -I${LOCALBASE}/include -I${LOCALBASE}/include/ffmpeg
-CFLAGS+=-I${LOCALBASE}/include/libavutil
-CFLAGS+=-DPREFIX='"${PREFIX}"' -DOS='"${OS}"' -DOSVERSION='"${VERS}"'
-CFLAGS+=-Wformat -Wunused -Wall
-CFLAGS+=-Wno-deprecated-declarations
-
-LDADD+= -L${LOCALBASE}/lib
-LDADD+= -lsqlite3 -ljpeg -lexif -lid3tag -logg -lvorbis -lFLAC -lavformat
-
-SRCS= albumart.c daemonize.c getifaddr.c image_utils.c log.c \
- metadata.c minidlna.c minissdp.c minixml.c options.c playlist.c \
- scanner.c sql.c upnpdescgen.c upnpevents.c upnpglobalvars.c \
- upnphttp.c upnpreplyparse.c upnpsoap.c utils.c uuid.c
-
-# TiVo-related sources still need massaging to compile on BSD:
-# SRCS+= tivo_beacon.c tivo_commands.c tivo_utils.c
-
-.PATH: ${FILESDIR} ${.CURDIR}/tagutils
-
-SRCS+= misc.c tagutils.c textutils.c
-
-WARNS= 3
-
-BINDIR= ${PREFIX}/sbin
-
-beforeinstall:
- ${INSTALL_DATA} ${.CURDIR}/minidlna.conf ${PREFIX}/etc/minidlna.conf.sample
- test -e ${PREFIX}/etc/minidlna.conf || \
- ${INSTALL_DATA} ${.CURDIR}/minidlna.conf ${PREFIX}/etc/minidlna.conf
-
-.include <bsd.prog.mk>
diff --git a/net/minidlna/files/config.h.in b/net/minidlna/files/config.h.in
deleted file mode 100644
index 10b7a3d7f41f..000000000000
--- a/net/minidlna/files/config.h.in
+++ /dev/null
@@ -1,34 +0,0 @@
-/* MiniDLNA Project
- * http://sourceforge.net/projects/minidlna/
- * (c) 2008-2009 Justin Maggard
- * generated by ./genconfig.sh on нд 13 чер 2010 00:06:49 EDT */
-#ifndef __CONFIG_H__
-#define __CONFIG_H__
-
-#define PFRULE_INOUT_COUNTS
-#define OS_NAME OS
-#define OS_VERSION OS "/" OSVERSION
-#define OS_URL "http://www." OS ".org/"
-
-/* full path of the file database */
-#define DEFAULT_DB_PATH "/var/db/minidlna"
-#define DEFAULT_LOG_PATH "/var/log"
-
-/* Comment the following line to use home made daemonize() func instead
- * of BSD daemon() */
-#define USE_DAEMON
-
-/* Enable if the system inotify.h exists. Otherwise our own inotify.h will be used. */
-/*#define HAVE_INOTIFY_H*/
-
-/* Enable if the system iconv.h exists. ID3 tag reading in various character sets will not work properly otherwise. */
-#define HAVE_ICONV_H
-
-/* Enable NETGEAR-specific tweaks. */
-/*#define NETGEAR*/
-/* Enable ReadyNAS-specific tweaks. */
-/*#define READYNAS*/
-/* Compile in TiVo support. */
-/* #define TIVO_SUPPORT -- not yet ported to FreeBSD */
-
-#endif
diff --git a/net/minidlna/files/getifaddr.c b/net/minidlna/files/getifaddr.c
deleted file mode 100644
index c87415271d79..000000000000
--- a/net/minidlna/files/getifaddr.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/* $Id: getifaddr.c,v 1.12 2010/11/11 23:48:13 jmaggard Exp $ */
-/* MiniUPnP project
- * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
- *
- * Copyright (c) 2006, Thomas Bernard
- * All rights reserved.
- *
- * Adapted to BSD by jayp and Mikhail T. -- 2010
- * William Grzybowski -- 2013
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <arpa/inet.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <errno.h>
-
-#include <netinet/in.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/sysctl.h>
-#include <arpa/inet.h>
-#include <net/route.h>
-#include <err.h>
-#include <netinet/if_ether.h>
-
-#include <ifaddrs.h>
-#include <sys/param.h>
-#include <net/if_dl.h>
-
-#include "upnpglobalvars.h"
-#include "getifaddr.h"
-#include "log.h"
-
-int
-getifaddr(const char * ifname, char * buf, int len)
-{
- /* SIOCGIFADDR struct ifreq * */
- int s;
- struct ifreq ifr;
- int ifrlen;
- struct sockaddr_in * addr;
- ifrlen = sizeof(ifr);
- s = socket(PF_INET, SOCK_DGRAM, 0);
- if(s < 0)
- {
- DPRINTF(E_ERROR, L_GENERAL, "socket(PF_INET, SOCK_DGRAM): %s\n", strerror(errno));
- return -1;
- }
- strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
- if(ioctl(s, SIOCGIFADDR, &ifr, &ifrlen) < 0)
- {
- DPRINTF(E_ERROR, L_GENERAL, "ioctl(s, SIOCGIFADDR, ...): %s\n", strerror(errno));
- close(s);
- return -1;
- }
- addr = (struct sockaddr_in *)&ifr.ifr_addr;
- if(!inet_ntop(AF_INET, &addr->sin_addr, buf, len))
- {
- DPRINTF(E_ERROR, L_GENERAL, "inet_ntop(): %s\n", strerror(errno));
- close(s);
- return -1;
- }
- close(s);
- return 0;
-}
-
-static int
-getsysifname(char * buf, size_t len)
-{
- int rv=-1;
- struct ifaddrs *ifap = NULL;
- struct ifaddrs *ifnr;
-
- if (getifaddrs(&ifap) != 0)
- err(1, "getifaddrs");
-
- for (ifnr = ifap; ifnr != NULL; ifnr = ifnr->ifa_next) {
- if (ifnr->ifa_addr->sa_family == AF_INET) {
- char *ifname=ifnr->ifa_name;
- struct sockaddr_in *addr_in =
- (struct sockaddr_in *)ifnr->ifa_addr;
-
- unsigned a =
- (htonl(addr_in->sin_addr.s_addr) >> 0x18) & 0xFF;
-
- if (a == 127)
- continue;
-
- if(!inet_ntop(AF_INET, &addr_in->sin_addr, buf, len)) {
- warn("inet_ntop()");
- break;
- }
- strncpy(buf, ifname, len);
- break;
- }
- rv=0;
- }
-
- freeifaddrs(ifap);
- return rv;
-}
-
-int
-getsyshwaddr(char *buf, int len)
-{
- struct ifaddrs *ifap;
- char sysifname[256];
- int rv=-1;
- uint8_t node[6];
- struct ifaddrs *p;
-
- if (getsysifname(sysifname, sizeof(sysifname)) != 0)
- return rv;
-
- if (getifaddrs(&ifap) != 0)
- err(1, "getifaddrs");
-
- for (p = ifap; p != NULL; p = p->ifa_next) {
- if (p->ifa_addr->sa_family == AF_LINK) {
- char *ifname=p->ifa_name;
- struct sockaddr_dl* sdp;
-
- if (strncmp(sysifname, ifname, sizeof(sysifname)))
- continue;
-
- sdp = (struct sockaddr_dl*) p->ifa_addr;
- memcpy(node, sdp->sdl_data + sdp->sdl_nlen, 6);
- if (len>12)
- sprintf(buf, "%02x%02x%02x%02x%02x%02x",
- node[0], node[1], node[2],
- node[3], node[4], node[5]);
- else
- memmove(buf, node, 6);
- rv=0;
- break;
- }
- }
- freeifaddrs(ifap);
- return rv;
-}
-
-int
-get_remote_mac(struct in_addr ip_addr, unsigned char *mac)
-{
- int found_entry=0;
- int mib[6];
- size_t needed;
- char *lim, *buf, *next;
- struct rt_msghdr *rtm;
- struct sockaddr_inarp *sin;
- struct sockaddr_dl *sdl;
-
- mib[0] = CTL_NET;
- mib[1] = PF_ROUTE;
- mib[2] = 0;
- mib[3] = AF_INET;
- mib[4] = NET_RT_FLAGS;
- mib[5] = RTF_LLINFO;
- if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
- err(1, "route-sysctl-estimate");
- if ((buf = malloc(needed)) == NULL)
- err(1, "malloc");
- if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0)
- err(1, "actual retrieval of routing table");
- lim = buf + needed;
- for (next = buf; next < lim; next += rtm->rtm_msglen) {
- rtm = (struct rt_msghdr *)next;
- sin = (struct sockaddr_inarp *)(rtm + 1);
- sdl = (struct sockaddr_dl *)(sin + 1);
- if (ip_addr.s_addr != sin->sin_addr.s_addr)
- continue;
- if (sdl->sdl_alen) {
- found_entry = 1;
- memmove(mac, (u_char *)LLADDR(sdl), 6);
- break;
- }
- }
-
- if(!found_entry)
- memset(mac, 0xFF, 6);
- free(buf);
- return !found_entry;
-}
-
-
-int
-getsysaddrs(void)
-{
- struct sockaddr_in *addr;
- struct ifaddrs *ifap, *ifa;
-
- getifaddrs(&ifap);
- for(ifa=ifap;ifa;ifa=ifa->ifa_next) {
- if(ifa->ifa_addr == NULL || ifa->ifa_netmask == NULL)
- continue;
-
- addr = (struct sockaddr_in *) ifa->ifa_addr;
- if(addr->sin_family != AF_INET)
- continue;
-
- memcpy(&lan_addr[n_lan_addr].addr, (void *) &addr->sin_addr, sizeof(lan_addr[n_lan_addr].addr));
- if( !inet_ntop(AF_INET, (void *) &addr->sin_addr, lan_addr[n_lan_addr].str, sizeof(lan_addr[0].str)) )
- {
- DPRINTF(E_ERROR, L_GENERAL, "inet_ntop(): %s\n", strerror(errno));
- continue;
- }
-
- addr = (struct sockaddr_in *) ifa->ifa_netmask;
- memcpy(&lan_addr[n_lan_addr].mask, (void *) &addr->sin_addr, sizeof(lan_addr[n_lan_addr].mask));
- n_lan_addr++;
- if (n_lan_addr >= MAX_LAN_ADDR)
- break;
- }
- freeifaddrs(ifap);
-
- return(n_lan_addr);
-}
diff --git a/net/minidlna/files/minidlna.in b/net/minidlna/files/minidlna.in
index b2803349c32c..0b45d37a62da 100644
--- a/net/minidlna/files/minidlna.in
+++ b/net/minidlna/files/minidlna.in
@@ -1,5 +1,4 @@
#!/bin/sh
-
# $FreeBSD$
#
# PROVIDE: minidlna
@@ -14,21 +13,21 @@
name=minidlna
rcvar=minidlna_enable
-command=%%PREFIX%%/sbin/minidlna
+command=%%PREFIX%%/sbin/minidlnad
load_rc_config $name
minidlna_enable=${minidlna_enable-"NO"}
minidlna_uid=${minidlna_uid-"%%USER%%"}
-pidfile="/var/db/minidlna/minidlna.pid"
+pidfile="/var/run/minidlna/minidlna.pid"
start_precmd="rm -f $pidfile"
stop_postcmd=$start_precmd
-command_args="-P $pidfile -u $minidlna_uid"
+command_args="-P $pidfile -u $minidlna_uid -f %%PREFIX%%/etc/minidlna.conf"
extra_commands=rescan
-rescan_cmd="$command -R -u $minidlna_uid"
-required_dirs="/var/db/minidlna"
+rescan_cmd="$command -R -u $minidlna_uid -f %%PREFIX%%/etc/minidlna.conf"
+required_dirs="/var/run/minidlna /var/db/minidlna"
run_rc_command $1
diff --git a/net/minidlna/files/patch-aa b/net/minidlna/files/patch-aa
deleted file mode 100644
index 37c2ab4bd711..000000000000
--- a/net/minidlna/files/patch-aa
+++ /dev/null
@@ -1,141 +0,0 @@
---- tagutils/tagutils.c 2010-12-13 01:41:52.000000000 -0500
-+++ tagutils/tagutils.c 2010-12-13 17:28:29.000000000 -0500
-@@ -36,6 +36,7 @@
- #include <vorbis/codec.h>
- #include <FLAC/metadata.h>
-+#include <libgen.h>
-
--#include "../config.h"
-+#include "config.h"
- #ifdef HAVE_ICONV_H
- #include <iconv.h>
---- image_utils.c 2011-05-03 18:07:47.000000000 -0400
-+++ image_utils.c 2011-08-24 01:11:13.000000000 -0400
-@@ -34,5 +34,5 @@
- #include <setjmp.h>
- #include <jpeglib.h>
--#include <endian.h>
-+#include <sys/endian.h>
-
- #include "upnpreplyparse.h"
---- upnpdescgen.c 2011-05-03 18:07:47.000000000 -0400
-+++ upnpdescgen.c 2011-08-24 01:32:48.000000000 -0400
-@@ -585,5 +585,5 @@
- const struct XMLElt * p)
- {
-- u_int16_t i, j, k;
-+ uint16_t i, j, k;
- int top;
- const char * eltname, *s;
---- upnpglobalvars.c 2011-05-26 19:10:54.000000000 -0400
-+++ upnpglobalvars.c 2011-08-24 01:33:57.000000000 -0400
-@@ -49,5 +49,5 @@
- #include <sys/types.h>
- #include <netinet/in.h>
--#include <linux/limits.h>
-+#include <limits.h>
-
- #include "config.h"
---- tagutils/misc.c 2010-11-11 18:48:14.000000000 -0500
-+++ tagutils/misc.c 2011-08-24 01:36:58.000000000 -0400
-@@ -22,5 +22,5 @@
- #include <stdio.h>
- #include <string.h>
--#include <endian.h>
-+#include <sys/endian.h>
-
- #include "misc.h"
---- uuid.c 2011-05-26 19:04:33.000000000 -0400
-+++ uuid.c 2011-08-24 01:56:11.000000000 -0400
-@@ -31,4 +31,5 @@
- #include <sys/syscall.h>
- #include <string.h>
-+#include <sys/socket.h>
- #include <net/if.h>
- #include <sys/ioctl.h>
-@@ -47,13 +48,4 @@
- static int clock_seq_initialized;
-
--unsigned long long
--monotonic_us(void)
--{
-- struct timespec ts;
--
-- syscall(__NR_clock_gettime, CLOCK_MONOTONIC, &ts);
-- return ts.tv_sec * 1000000ULL + ts.tv_nsec / 1000;
--}
--
--int
-+static int
- read_bootid_node(unsigned char *buf, size_t size)
-@@ -82,26 +74,13 @@
- read_random_bytes(unsigned char *buf, size_t size)
- {
-- int i;
-- pid_t pid;
-+ long r;
-+ srandomdev();
-
-- i = open("/dev/urandom", O_RDONLY);
-- if(i >= 0)
-- {
-- read(i, buf, size);
-- close(i);
-- }
-- /* Paranoia. /dev/urandom may be missing.
-- * rand() is guaranteed to generate at least [0, 2^15) range,
-- * but lowest bits in some libc are not so "random". */
-- srand(monotonic_us());
-- pid = getpid();
-- while(1)
-- {
-- for(i = 0; i < size; i++)
-- buf[i] ^= rand() >> 5;
-- if(pid == 0)
-- break;
-- srand(pid);
-- pid = 0;
-+ while ((ssize_t)size > 0) {
-+ r = random();
-+ memcpy(buf, &r,
-+ size > sizeof(r) ? sizeof(r) : size);
-+ buf += sizeof(r);
-+ size -= sizeof(r);
- }
- }
-@@ -163,5 +142,5 @@
- * Gregorian reform to the Christian calendar).
- */
-- syscall(__NR_clock_gettime, CLOCK_REALTIME, &ts);
-+ clock_gettime(CLOCK_REALTIME, &ts);
- time_all = ((u_int64_t)ts.tv_sec) * (NSEC_PER_SEC / 100);
- time_all += ts.tv_nsec / 100;
---- tagutils/tagutils-asf.h 2010-11-11 18:48:14.000000000 -0500
-+++ tagutils/tagutils-asf.h 2011-08-24 01:57:26.000000000 -0400
-@@ -24,5 +24,5 @@
- #define __PACKED__ __attribute__((packed))
-
--#include <endian.h>
-+#include <sys/endian.h>
-
- typedef struct _GUID {
---- utils.c 2011-07-18 14:13:25.000000000 -0400
-+++ utils.c 2011-09-21 00:58:47.000000000 -0400
-@@ -207,11 +207,15 @@
- }
-
-- if (mkdir(path, mode) < 0) {
-+ if (!(path[0] == '/' && s == path + 1) /* skip "/" */
-+ && mkdir(path, mode) < 0) {
-+ int e = errno;
- /* If we failed for any other reason than the directory
- * already exists, output a diagnostic and return -1.*/
- if (errno != EEXIST || (stat(path, &st) < 0 || !S_ISDIR(st.st_mode))) {
-- DPRINTF(E_WARN, L_GENERAL, "make_dir: cannot create directory '%s'\n", path);
- if (c)
- *s = c;
-+ DPRINTF(E_WARN, L_GENERAL, "make_dir: cannot "
-+ "create directory '%.*s' (to create %s): "
-+ "%s\n", s - path, path, path, strerror(e));
- return -1;
- }
diff --git a/net/minidlna/files/patch-ab b/net/minidlna/files/patch-ab
deleted file mode 100644
index f02c0ee6c4ba..000000000000
--- a/net/minidlna/files/patch-ab
+++ /dev/null
@@ -1,9 +0,0 @@
---- tagutils/tagutils-misc.c 2010-12-13 01:41:52.000000000 -0500
-+++ tagutils/tagutils-misc.c 2010-12-13 17:31:49.000000000 -0500
-@@ -34,5 +34,5 @@
- static iconv_result
- do_iconv(const char* to_ces, const char* from_ces,
-- char *inbuf, size_t inbytesleft,
-+ const char *inbuf, size_t inbytesleft,
- char *outbuf_orig, size_t outbytesleft_orig)
- {
diff --git a/net/minidlna/files/patch-clang-inline b/net/minidlna/files/patch-clang-inline
new file mode 100644
index 000000000000..f68c6119f6af
--- /dev/null
+++ b/net/minidlna/files/patch-clang-inline
@@ -0,0 +1,137 @@
+diff --git tagutils/misc.c tagutils/misc.c
+index 98ad543..5dc94e5 100644
+--- tagutils/misc.c
++++ tagutils/misc.c
+@@ -30,7 +30,7 @@
+
+ #include "misc.h"
+
+-inline __u16
++__u16
+ le16_to_cpu(__u16 le16)
+ {
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
+@@ -41,7 +41,7 @@ le16_to_cpu(__u16 le16)
+ #endif
+ }
+
+-inline __u32
++__u32
+ le32_to_cpu(__u32 le32)
+ {
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
+@@ -56,7 +56,7 @@ le32_to_cpu(__u32 le32)
+ #endif
+ }
+
+-inline __u64
++__u64
+ le64_to_cpu(__u64 le64)
+ {
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
+@@ -77,7 +77,7 @@ le64_to_cpu(__u64 le64)
+ #endif
+ }
+
+-inline __u8
++__u8
+ fget_byte(FILE *fp)
+ {
+ __u8 d;
+@@ -87,7 +87,7 @@ fget_byte(FILE *fp)
+ return d;
+ }
+
+-inline __u16
++__u16
+ fget_le16(FILE *fp)
+ {
+ __u16 d;
+@@ -98,7 +98,7 @@ fget_le16(FILE *fp)
+ return d;
+ }
+
+-inline __u32
++__u32
+ fget_le32(FILE *fp)
+ {
+ __u32 d;
+@@ -109,7 +109,7 @@ fget_le32(FILE *fp)
+ return d;
+ }
+
+-inline __u32
++__u32
+ cpu_to_be32(__u32 cpu32)
+ {
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
+diff --git tagutils/misc.h tagutils/misc.h
+index c7642fe..fc488a1 100644
+--- tagutils/misc.h
++++ tagutils/misc.h
+@@ -37,14 +37,14 @@ typedef signed long long __s64;
+ #endif
+
+
+-inline __u16 le16_to_cpu(__u16 le16);
+-inline __u32 le32_to_cpu(__u32 le32);
+-inline __u64 le64_to_cpu(__u64 le64);
+-inline __u8 fget_byte(FILE *fp);
+-inline __u16 fget_le16(FILE *fp);
+-inline __u32 fget_le32(FILE *fp);
+-
+-inline __u32 cpu_to_be32(__u32 cpu32);
++__u16 le16_to_cpu(__u16 le16);
++__u32 le32_to_cpu(__u32 le32);
++__u64 le64_to_cpu(__u64 le64);
++__u8 fget_byte(FILE *fp);
++__u16 fget_le16(FILE *fp);
++__u32 fget_le32(FILE *fp);
++
++__u32 cpu_to_be32(__u32 cpu32);
+
+ extern char * sha1_hex(char *key);
+
+diff --git utils.c utils.c
+index 57ae5a4..d46f2f0 100644
+--- utils.c
++++ utils.c
+@@ -33,7 +33,7 @@
+ #include "upnpglobalvars.h"
+ #include "log.h"
+
+-inline int
++int
+ strcatf(struct string_s *str, const char *fmt, ...)
+ {
+ int ret;
+@@ -52,14 +52,14 @@ strcatf(struct string_s *str, const char *fmt, ...)
+ return ret;
+ }
+
+-inline void
++void
+ strncpyt(char *dst, const char *src, size_t len)
+ {
+ strncpy(dst, src, len);
+ dst[len-1] = '\0';
+ }
+
+-inline int
++int
+ xasprintf(char **strp, char *fmt, ...)
+ {
+ va_list args;
+diff --git utils.h utils.h
+index d9d49a4..fbff582 100644
+--- utils.h
++++ utils.h
+@@ -29,7 +29,7 @@
+ /* String functions */
+ int strcatf(struct string_s *str, char *fmt, ...);
+ void strncpyt(char *dst, const char *src, size_t len);
+-inline int xasprintf(char **strp, char *fmt, ...);
++int xasprintf(char **strp, char *fmt, ...);
+ int ends_with(const char * haystack, const char * needle);
+ char *trim(char *str);
+ char *strstrc(const char *s, const char *p, const char t);
diff --git a/net/minidlna/files/patch-clients.h b/net/minidlna/files/patch-clients.h
new file mode 100644
index 000000000000..c63fec11e4ea
--- /dev/null
+++ b/net/minidlna/files/patch-clients.h
@@ -0,0 +1,12 @@
+diff --git clients.h clients.h
+index d3ffe1d..2a4c579 100644
+--- clients.h
++++ clients.h
+@@ -1,6 +1,7 @@
+ #ifndef __CLIENTS_H__
+ #define __CLIENTS_H__
+ #include <stdint.h>
++#include <sys/time.h>
+ #include <netinet/in.h>
+
+ #define CLIENT_CACHE_SLOTS 20
diff --git a/net/minidlna/files/patch-conf b/net/minidlna/files/patch-conf
deleted file mode 100644
index ede7f85f696e..000000000000
--- a/net/minidlna/files/patch-conf
+++ /dev/null
@@ -1,13 +0,0 @@
---- minidlna.conf 2011-07-22 19:03:38.000000000 -0400
-+++ minidlna.conf 2011-09-21 01:02:25.000000000 -0400
-@@ -18,8 +18,8 @@
-
- # set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache
--#db_dir=/var/cache/minidlna
-+db_dir=/var/db/minidlna
-
- # set this if you would like to specify the directory where you want MiniDLNA to store its log file
--#log_dir=/var/log
-+log_dir=/var/db/minidlna
-
- # this should be a list of file names to check for when searching for album art
diff --git a/net/minidlna/files/patch-getifaddr.c b/net/minidlna/files/patch-getifaddr.c
new file mode 100644
index 000000000000..a0fa7b197fe9
--- /dev/null
+++ b/net/minidlna/files/patch-getifaddr.c
@@ -0,0 +1,13 @@
+diff --git getifaddr.c getifaddr.c
+index 9c437b7..5eb6716 100644
+--- getifaddr.c
++++ getifaddr.c
+@@ -175,7 +175,7 @@ getsysaddrs(void)
+ if (p->ifa_addr && p->ifa_addr->sa_family == AF_INET)
+ {
+ addr_in = (struct sockaddr_in *)p->ifa_addr;
+- if (p->ifa_flags & (IFF_LOOPBACK | IFF_SLAVE))
++ if (p->ifa_flags & (IFF_LOOPBACK))
+ continue;
+ memcpy(&lan_addr[n_lan_addr].addr, &addr_in->sin_addr, sizeof(lan_addr[n_lan_addr].addr));
+ if (!inet_ntop(AF_INET, &addr_in->sin_addr, lan_addr[n_lan_addr].str, sizeof(lan_addr[0].str)) )
diff --git a/net/minidlna/files/patch-inline b/net/minidlna/files/patch-inline
deleted file mode 100644
index 370a5942ca21..000000000000
--- a/net/minidlna/files/patch-inline
+++ /dev/null
@@ -1,23 +0,0 @@
---- tagutils/misc.h 2009-02-25 16:16:51.000000000 -0500
-+++ tagutils/misc.h 2010-07-08 07:30:12.000000000 -0400
-@@ -38,13 +38,12 @@
- #endif
-
-+__u16 le16_to_cpu(__u16 le16);
-+__u32 le32_to_cpu(__u32 le32);
-+__u64 le64_to_cpu(__u64 le64);
-+__u8 fget_byte(FILE *fp);
-+__u16 fget_le16(FILE *fp);
-+__u32 fget_le32(FILE *fp);
-
--inline __u16 le16_to_cpu(__u16 le16);
--inline __u32 le32_to_cpu(__u32 le32);
--inline __u64 le64_to_cpu(__u64 le64);
--inline __u8 fget_byte(FILE *fp);
--inline __u16 fget_le16(FILE *fp);
--inline __u32 fget_le32(FILE *fp);
--
--inline __u32 cpu_to_be32(__u32 cpu32);
-+__u32 cpu_to_be32(__u32 cpu32);
-
- extern char * sha1_hex(char *key);
diff --git a/net/minidlna/files/patch-lg b/net/minidlna/files/patch-lg
deleted file mode 100644
index 6ceb040e161a..000000000000
--- a/net/minidlna/files/patch-lg
+++ /dev/null
@@ -1,19 +0,0 @@
-Patch from:
-
-http://sourceforge.net/tracker/?func=detail&aid=3459128&group_id=243163&atid=1121518
-
-diff -u -b -p -d -r1.104 upnpsoap.c
---- upnpsoap.c 23 Nov 2011 22:41:42 -0000 1.104
-+++ upnpsoap.c 13 Dec 2011 20:45:33 -0000
-@@ -754,9 +754,9 @@ callback(void *args, int argc, char **ar
- ret = strcatf(str, " refID=\"%s\"", refID);
- }
- ret = strcatf(str, "&gt;"
-- "&lt;dc:title&gt;%s&lt;/dc:title&gt;"
-+ "&lt;dc:title&gt;%s%s&lt;/dc:title&gt;"
- "&lt;upnp:class&gt;object.%s&lt;/upnp:class&gt;",
-- title, class);
-+ title, ((strchr(title, '.') == NULL && (passed_args->filter & FILTER_RES) && *mime == 'v' && passed_args->client == ELGDevice) ? "." : ""), class);
- if( comment && (passed_args->filter & FILTER_DC_DESCRIPTION) ) {
- ret = strcatf(str, "&lt;dc:description&gt;%.384s&lt;/dc:description&gt;", comment);
- }
diff --git a/net/minidlna/files/patch-minidlna.c b/net/minidlna/files/patch-minidlna.c
deleted file mode 100644
index 783383069d85..000000000000
--- a/net/minidlna/files/patch-minidlna.c
+++ /dev/null
@@ -1,89 +0,0 @@
---- minidlna.c 2012-02-14 13:26:53.000000000 -0500
-+++ minidlna.c 2012-04-11 11:18:28.000000000 -0400
-@@ -53,4 +53,5 @@
- #include <ctype.h>
- #include <sys/types.h>
-+#include <sys/stat.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
-@@ -66,4 +67,8 @@
- #include <pwd.h>
-
-+#include <err.h>
-+#include <stdint.h>
-+#include <sysexits.h>
-+
- #include "config.h"
-
-@@ -86,5 +91,7 @@
- #include "upnpevents.h"
- #include "scanner.h"
-+#ifdef __linux__
- #include "inotify.h"
-+#endif
- #include "log.h"
- #ifdef TIVO_SUPPORT
-@@ -342,5 +349,5 @@
- struct sigaction sa;
- const char * presurl = NULL;
-- const char * optionsfile = "/etc/minidlna.conf";
-+ const char * optionsfile = PREFIX "/etc/minidlna.conf";
- char mac_str[13];
- char * string, * word;
-@@ -352,4 +359,5 @@
- char *log_level = NULL;
-
-+ uid_t uid = (uid_t)-1;
- /* first check if "-f" option is used */
- for(i=2; i<argc; i++)
-@@ -740,4 +748,21 @@
- exit(0);
- break;
-+ case 'u':
-+ if(i+1 == argc)
-+ err(EX_USAGE, "Option -%c takes one argument.", argv[i][1]);
-+ else {
-+ char *endp;
-+ i++;
-+ uid = strtol(argv[i], &endp, 0);
-+ if (*endp) {
-+ /* Symbolic username given, not UID. */
-+ struct passwd *entry = getpwnam(argv[i]);
-+
-+ if (entry == NULL)
-+ err(EX_NOUSER, "%s", argv[i]);
-+ uid = entry->pw_uid;
-+ }
-+ }
-+ break;
- default:
- DPRINTF(E_ERROR, L_GENERAL, "Unknown option: %s\n", argv[i]);
-@@ -767,4 +792,5 @@
- "\t\t[-s serial] [-m model_number] \n"
- "\t\t[-t notify_interval] [-P pid_filename]\n"
-+ "\t\t[-u uid_to_run_as]\n"
- "\t\t[-w url] [-R] [-V] [-h]\n"
- "\nNotes:\n\tNotify interval is in seconds. Default is 895 seconds.\n"
-@@ -839,4 +865,7 @@
- writepidfile(pidfilename, pid);
-
-+ if (uid != (uid_t)-1 && setuid(uid) == -1)
-+ err(EX_NOPERM, "setuid(%ld)", (long)uid);
-+
- return 0;
- }
-@@ -965,4 +995,5 @@
- }
- signal(SIGCHLD, SIG_IGN);
-+#if defined(__linux__)
- if( sqlite3_threadsafe() && sqlite3_libversion_number() >= 3005001 &&
- GETFLAG(INOTIFY_MASK) && pthread_create(&inotify_thread, NULL, start_inotify, NULL) )
-@@ -970,6 +1001,7 @@
- DPRINTF(E_FATAL, L_GENERAL, "ERROR: pthread_create() failed for start_inotify.\n");
- }
-+#endif
-
-- sudp = OpenAndConfSSDPReceiveSocket(n_lan_addr, lan_addr);
-+ sudp = OpenAndConfSSDPReceiveSocket();
- if(sudp < 0)
- {
diff --git a/net/minidlna/files/patch-minidlna.conf b/net/minidlna/files/patch-minidlna.conf
new file mode 100644
index 000000000000..e2131d7e99ff
--- /dev/null
+++ b/net/minidlna/files/patch-minidlna.conf
@@ -0,0 +1,13 @@
+diff --git minidlna.conf minidlna.conf
+index bfb71d5..b579912 100644
+--- minidlna.conf
++++ minidlna.conf
+@@ -21,7 +21,7 @@ media_dir=/opt
+ #friendly_name=My DLNA Server
+
+ # set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache
+-#db_dir=/var/cache/minidlna
++#db_dir=/var/db/minidlna
+
+ # set this if you would like to specify the directory where you want MiniDLNA to store its log file
+ #log_dir=/var/log
diff --git a/net/minidlna/files/patch-other-subnets b/net/minidlna/files/patch-other-subnets
deleted file mode 100644
index 38b6995e7db2..000000000000
--- a/net/minidlna/files/patch-other-subnets
+++ /dev/null
@@ -1,25 +0,0 @@
-Allowing SSDP M-SEARCH from other subnets. See:
-http://sourceforge.net/tracker/?func=detail&aid=3495642&group_id=243163&atid=1121518
---- minissdp.c
-+++ minissdp.c
-@@ -674,9 +674,17 @@ ProcessSSDPRequest(int s, unsigned short
- }
- if( i == n_lan_addr )
- {
-- DPRINTF(E_DEBUG, L_SSDP, "Ignoring SSDP M-SEARCH on other interface [%s]\n",
-- inet_ntoa(sendername.sin_addr));
-- return;
-+ if( n_lan_addr == 1 )
-+ {
-+ DPRINTF(E_INFO, L_SSDP, "SSDP M-SEARCH coming from another subnet [%s]\n",
-+ inet_ntoa(sendername.sin_addr));
-+ }
-+ else
-+ {
-+ DPRINTF(E_DEBUG, L_SSDP, "Ignoring SSDP M-SEARCH on other interface [%s]\n",
-+ inet_ntoa(sendername.sin_addr));
-+ return;
-+ }
- }
- DPRINTF(E_INFO, L_SSDP, "SSDP M-SEARCH from %s:%d ST: %.*s, MX: %.*s, MAN: %.*s\n",
- inet_ntoa(sendername.sin_addr),
diff --git a/net/minidlna/files/patch-replace-glob3 b/net/minidlna/files/patch-replace-glob3
deleted file mode 100644
index 2ce2fb9056c9..000000000000
--- a/net/minidlna/files/patch-replace-glob3
+++ /dev/null
@@ -1,16 +0,0 @@
-See
-http://sourceforge.net/tracker/?func=detail&aid=3511519&group_id=243163&atid=1121518
---- metadata.c 2012-02-14 22:44:56.000000000 +0400
-+++ metadata.c 2012-03-28 10:55:52.000000000 +0400
-@@ -160,8 +160,8 @@
- /* If we weren't given a detail ID, look for one. */
- if( !detailID )
- {
-- id = sql_get_text_field(db, "SELECT ID from DETAILS where PATH glob '%q.*'"
-- " and MIME glob 'video/*' limit 1", file);
-+ id = sql_get_text_field(db, "SELECT ID from DETAILS where (PATH > '%q.' and PATH <= '%q.z'"
-+ " and MIME > 'video/' and MIME <= 'video/z') limit 1", file, file);
- if( id )
- {
- //DEBUG DPRINTF(E_DEBUG, L_METADATA, "New file %s looks like a caption file.\n", path);
-
diff --git a/net/minidlna/files/patch-type-mismatch b/net/minidlna/files/patch-type-mismatch
deleted file mode 100644
index de028f04b8c0..000000000000
--- a/net/minidlna/files/patch-type-mismatch
+++ /dev/null
@@ -1,52 +0,0 @@
-diff --git log.c log.c
-index 91aa564..3f3b503 100644
---- log.c
-+++ log.c
-@@ -63,14 +63,14 @@ log_init(const char *fname, const char *debug)
- if (debug)
- {
- const char *rhs, *lhs, *nlhs, *p;
-- int n;
-+ size_t n;
- int level, facility;
- memset(&log_level_set, 0, sizeof(log_level_set));
- rhs = nlhs = debug;
- while (rhs && (rhs = strchr(rhs, '='))) {
- rhs++;
- p = strchr(rhs, ',');
-- n = p ? p - rhs : strlen(rhs);
-+ n = p ? (size_t) (p - rhs) : strlen(rhs);
- for (level=0; level_name[level]; level++) {
- if (!(strncasecmp(level_name[level], rhs, n)))
- break;
-@@ -84,7 +84,7 @@ log_init(const char *fname, const char *debug)
- do {
- if (*lhs==',') lhs++;
- p = strpbrk(lhs, ",=");
-- n = p ? p - lhs : strlen(lhs);
-+ n = p ? (size_t) (p - lhs) : strlen(lhs);
- for (facility=0; facility_name[facility]; facility++) {
- if (!(strncasecmp(facility_name[facility], lhs, n)))
- break;
-diff --git tagutils/tagutils-wav.c tagutils/tagutils-wav.c
-index 956eef7..f2e397e 100644
---- tagutils/tagutils-wav.c
-+++ tagutils/tagutils-wav.c
-@@ -33,7 +33,7 @@ static int
- _get_wavtags(char *filename, struct song_metadata *psong)
- {
- int fd;
-- uint32_t len;
-+ ssize_t len;
- unsigned char hdr[12];
- unsigned char fmt[16];
- //uint32_t chunk_data_length;
-@@ -47,7 +47,7 @@ _get_wavtags(char *filename, struct song_metadata *psong)
- uint32_t sec, ms;
-
- uint32_t current_offset;
-- uint32_t block_len;
-+ int32_t block_len;
-
- //DEBUG DPRINTF(E_DEBUG,L_SCANNER,"Getting WAV file info\n");
-
diff --git a/net/minidlna/files/patch-upnphttp b/net/minidlna/files/patch-upnphttp
deleted file mode 100644
index afdc2bdb2ade..000000000000
--- a/net/minidlna/files/patch-upnphttp
+++ /dev/null
@@ -1,60 +0,0 @@
---- upnphttp.c 2010-12-13 01:41:52.000000000 -0500
-+++ upnphttp.c 2010-12-13 17:28:08.000000000 -0500
-@@ -66,5 +66,4 @@
- #include <fcntl.h>
- #include <errno.h>
--#include <sys/sendfile.h>
- #include <arpa/inet.h>
-
-@@ -80,10 +79,16 @@
- #include "tivo_commands.h"
- #endif
-+#ifdef __linux__
- //#define MAX_BUFFER_SIZE 4194304 // 4MB -- Too much?
- #define MAX_BUFFER_SIZE 2147483647 // 2GB -- Too much?
- #define MIN_BUFFER_SIZE 65536
-+#endif
-
- #include "icons.c"
-
-+#ifndef MSG_MORE /* A Linux-only flag for send(2) */
-+# define MSG_MORE 0
-+#endif
-+
- struct upnphttp *
- New_upnphttp(int s)
-@@ -1115,6 +1120,7 @@
- }
-
--void
-+static void
- send_file(struct upnphttp * h, int sendfd, off_t offset, off_t end_offset)
-+#if defined(__linux__)
- {
- off_t send_size;
-@@ -1166,4 +1172,25 @@
- free(buf);
- }
-+#elif defined(__FreeBSD__) || defined(__NetBSD__) || \
-+ defined(__OpenBSD__) || defined(__DragonFlyBSD__)
-+{
-+
-+ off_t sent;
-+
-+ while (offset < end_offset)
-+ {
-+ if (sendfile(sendfd, h->socket, offset,
-+ end_offset - offset + 1, NULL, &sent, SF_MNOWAIT) == -1) {
-+ DPRINTF(E_ERROR, L_HTTP,
-+ "sendfile error :: error no. %d [%s]\n",
-+ errno, strerror(errno));
-+ if (errno != EAGAIN)
-+ break;
-+ }
-+ offset += sent;
-+
-+ }
-+}
-+#endif
-
- void
diff --git a/net/minidlna/files/patch-utils-mpo b/net/minidlna/files/patch-utils.c-mpo
index 870dcfd699a2..d612e7b81d0b 100644
--- a/net/minidlna/files/patch-utils-mpo
+++ b/net/minidlna/files/patch-utils.c-mpo
@@ -1,11 +1,8 @@
-Submitted by Vladimir B. Grebenschikov this patch recognizes Samsung's
-images as JPEGs.
-
diff --git utils.c utils.c
-index 36ff168..5a7ff87 100644
+index d46f2f0..15e7905 100644
--- utils.c
+++ utils.c
-@@ -324,7 +324,7 @@ is_audio(const char * file)
+@@ -396,7 +396,7 @@ is_audio(const char * file)
int
is_image(const char * file)
{
diff --git a/net/minidlna/files/patch-warnings b/net/minidlna/files/patch-warnings
deleted file mode 100644
index 55da4ab49614..000000000000
--- a/net/minidlna/files/patch-warnings
+++ /dev/null
@@ -1,850 +0,0 @@
-diff --git albumart.c albumart.c
-index 54899c6..6cc6192 100644
---- albumart.c
-+++ albumart.c
-@@ -156,7 +156,7 @@ update_if_album_art(const char *path)
- closedir(dh);
- }
-
--char *
-+static char *
- check_embedded_art(const char *path, const char *image_data, int image_size)
- {
- int width = 0, height = 0;
-@@ -217,7 +217,7 @@ check_embedded_art(const char *path, const char *image_data, int image_size)
- }
- else if( width > 0 && height > 0 )
- {
-- size_t nwritten;
-+ int nwritten;
- if( art_cache_exists(path, &art_path) )
- goto end_art;
- cache_dir = strdup(art_path);
-diff --git image_utils.c image_utils.c
-index ee4fcf3..09330a3 100644
---- image_utils.c
-+++ image_utils.c
-@@ -172,7 +172,7 @@ term_source(j_decompress_ptr cinfo)
- return;
- }
-
--void
-+static void
- jpeg_memory_src(j_decompress_ptr cinfo, const unsigned char * buffer, size_t bufsize)
- {
- struct my_src_mgr *src;
-@@ -208,7 +208,7 @@ image_free(image_s *pimage)
- free(pimage);
- }
-
--pix
-+static pix
- get_pix(image_s *pimage, int32_t x, int32_t y)
- {
- if((x >= 0) && (y >= 0) && (x < pimage->width) && (y < pimage->height))
-@@ -222,7 +222,7 @@ get_pix(image_s *pimage, int32_t x, int32_t y)
- }
- }
-
--void
-+static void
- put_pix_alpha_replace(image_s *pimage, int32_t x, int32_t y, pix col)
- {
- if((x >= 0) && (y >= 0) && (x < pimage->width) && (y < pimage->height))
-@@ -398,7 +398,7 @@ image_get_jpeg_date_xmp(const char * path, char ** date)
- return ret;
- }
-
--image_s *
-+static image_s *
- image_new(int32_t width, int32_t height)
- {
- image_s *vimage;
-@@ -563,7 +563,7 @@ image_new_from_jpeg(const char * path, int is_file, const char * buf, int size,
- return vimage;
- }
-
--void
-+static void
- image_upsize(image_s * pdest, image_s * psrc, int32_t width, int32_t height)
- {
- int32_t vx, vy;
-@@ -626,7 +626,7 @@ image_upsize(image_s * pdest, image_s * psrc, int32_t width, int32_t height)
- }
- }
-
--void
-+static void
- image_downsize(image_s * pdest, image_s * psrc, int32_t width, int32_t height)
- {
- int32_t vx, vy;
-diff --git metadata.c metadata.c
-index 39a65ef..0ce2ceb 100644
---- metadata.c
-+++ metadata.c
-@@ -21,6 +21,7 @@
- #include <stdlib.h>
- #include <sys/stat.h>
-
-+#include <libgen.h>
- #include <unistd.h>
- #include <sys/types.h>
- #include <sys/stat.h>
-@@ -118,7 +119,7 @@ lav_close(AVFormatContext *ctx)
- }
-
- #if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0)
--# if LIBAVUTIL_VERSION_INT < ((51<<16)+(5<<8)+0)
-+# if LIBAVUTIL_VERSION_INT < ((51<<16)+(5<<8)+0) && LIBAVUTIL_VERSION_INT < AV_VERSION_INT(50, 43, 0)
- #define AV_DICT_IGNORE_SUFFIX AV_METADATA_IGNORE_SUFFIX
- #define av_dict_get av_metadata_get
- typedef AVMetadataTag AVDictionaryEntry;
-@@ -129,7 +130,7 @@ typedef AVMetadataTag AVDictionaryEntry;
- #define MPEG_TS_SYNC_CODE 0x47
- #define MPEG_TS_PACKET_LENGTH 188
- #define MPEG_TS_PACKET_LENGTH_DLNA 192 /* prepends 4 bytes to TS packet */
--int
-+static int
- dlna_timestamp_is_present(const char * filename, int * raw_packet_size)
- {
- unsigned char buffer[3*MPEG_TS_PACKET_LENGTH_DLNA];
-@@ -222,7 +223,7 @@ no_source_video:
- free(file);
- }
-
--void
-+static void
- parse_nfo(const char * path, metadata_t * m)
- {
- FILE *nfo;
-@@ -273,7 +274,7 @@ parse_nfo(const char * path, metadata_t * m)
- fclose(nfo);
- }
-
--void
-+static void
- free_metadata(metadata_t * m, uint32_t flags)
- {
- if( flags & FLAG_TITLE )
-@@ -712,7 +713,8 @@ sqlite_int64
- GetVideoMetadata(const char * path, char * name)
- {
- struct stat file;
-- int ret, i;
-+ int ret;
-+ unsigned i;
- struct tm *modtime;
- AVFormatContext *ctx = NULL;
- AVCodecContext *ac = NULL, *vc = NULL;
-diff --git minissdp.c minissdp.c
-index 81ae23e..ac492db 100644
---- minissdp.c
-+++ minissdp.c
-@@ -292,7 +292,8 @@ SendSSDPNotifies(int s, const char * host, unsigned short port,
- unsigned int lifetime)
- {
- struct sockaddr_in sockname;
-- int l, n, dup, i=0;
-+ int n, dup, i=0;
-+ size_t l;
- char bufr[512];
-
- memset(&sockname, 0, sizeof(struct sockaddr_in));
-@@ -355,7 +356,7 @@ SendSSDPNotifies2(int * sockets,
- }
- }
-
--void
-+static void
- ParseUPnPClient(char *location)
- {
- char buf[8192];
-diff --git minissdp.h minissdp.h
-index bcc7ff4..be8cb5d 100644
---- minissdp.h
-+++ minissdp.h
-@@ -32,7 +32,7 @@
- /*#include "minidlnatypes.h"*/
-
- int
--OpenAndConfSSDPReceiveSocket();
-+OpenAndConfSSDPReceiveSocket(void);
- /* OpenAndConfSSDPReceiveSocket(int n_lan_addr, struct lan_addr_s * lan_addr);*/
-
- /*int
-diff --git minixml.c minixml.c
-index 3dfb9a2..0831443 100644
---- minixml.c
-+++ minixml.c
-@@ -34,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
- /* parseatt : used to parse the argument list
- * return 0 (false) in case of success and -1 (true) if the end
- * of the xmlbuffer is reached. */
--int parseatt(struct xmlparser * p)
-+static int parseatt(struct xmlparser * p)
- {
- const char * attname;
- int attnamelen;
-@@ -105,7 +105,7 @@ int parseatt(struct xmlparser * p)
-
- /* parseelt parse the xml stream and
- * call the callback functions when needed... */
--void parseelt(struct xmlparser * p)
-+static void parseelt(struct xmlparser * p)
- {
- int i;
- const char * elementname;
-diff --git options.c options.c
-index 435cf9b..1b2d825 100644
---- options.c
-+++ options.c
-@@ -74,7 +74,7 @@ readoptionsfile(const char * fname)
- char *value;
- char *t;
- int linenum = 0;
-- int i;
-+ size_t i;
- enum upnpconfigoptions id;
-
- if(!fname || (strlen(fname) == 0))
-diff --git playlist.c playlist.c
-index 789b48c..8cf1df7 100644
---- playlist.c
-+++ playlist.c
-@@ -35,6 +35,7 @@
- #include "utils.h"
- #include "sql.h"
- #include "log.h"
-+#include "playlist.h"
-
- int
- insert_playlist(const char * path, char * name)
-diff --git scanner.c scanner.c
-index dc10229..abd0c89 100644
---- scanner.c
-+++ scanner.c
-@@ -23,6 +23,7 @@
- #include <locale.h>
- #include <libgen.h>
- #include <inttypes.h>
-+#include <limits.h>
- #include <sys/stat.h>
- #include <sys/time.h>
- #include <sys/resource.h>
-@@ -76,7 +77,7 @@ get_next_available_id(const char * table, const char * parentID)
- return objectID;
- }
-
--int
-+static int
- insert_container(const char * item, const char * rootParent, const char * refID, const char *class,
- const char *artist, const char *genre, const char *album_art, sqlite3_int64 *objectID, sqlite3_int64 *parentID)
- {
-@@ -169,7 +170,7 @@ insert_containers(const char * name, const char *path, const char * refID, const
- else
- {
- insert_container(date_taken, IMAGE_DATE_ID, NULL, "album.photoAlbum", NULL, NULL, NULL, &objectID, &parentID);
-- sprintf(last_date.parentID, IMAGE_DATE_ID"$%"PRIX64, parentID);
-+ sprintf(last_date.parentID, IMAGE_DATE_ID"$%"PRIX64, (int64_t)parentID);
- last_date.objectID = objectID;
- strcpy(last_date.name, date_taken);
- //DEBUG DPRINTF(E_DEBUG, L_SCANNER, "Creating cached date item: %s/%s/%X\n", last_date.name, last_date.parentID, last_date.objectID);
-@@ -192,7 +193,7 @@ insert_containers(const char * name, const char *path, const char * refID, const
- if( !valid_cache || strcmp(camera, last_cam.name) != 0 )
- {
- insert_container(camera, IMAGE_CAMERA_ID, NULL, "storageFolder", NULL, NULL, NULL, &objectID, &parentID);
-- sprintf(last_cam.parentID, IMAGE_CAMERA_ID"$%"PRIX64, parentID);
-+ sprintf(last_cam.parentID, IMAGE_CAMERA_ID"$%"PRIX64, (int64_t)parentID);
- strncpy(last_cam.name, camera, 255);
- last_camdate.name[0] = '\0';
- }
-@@ -204,7 +205,7 @@ insert_containers(const char * name, const char *path, const char * refID, const
- else
- {
- insert_container(date_taken, last_cam.parentID, NULL, "album.photoAlbum", NULL, NULL, NULL, &objectID, &parentID);
-- sprintf(last_camdate.parentID, "%s$%"PRIX64, last_cam.parentID, parentID);
-+ sprintf(last_camdate.parentID, "%s$%"PRIX64, last_cam.parentID, (int64_t)parentID);
- last_camdate.objectID = objectID;
- strcpy(last_camdate.name, date_taken);
- //DEBUG DPRINTF(E_DEBUG, L_SCANNER, "Creating cached camdate item: %s/%s/%s/%X\n", camera, last_camdate.name, last_camdate.parentID, last_camdate.objectID);
-@@ -273,12 +274,12 @@ insert_containers(const char * name, const char *path, const char * refID, const
- if( !valid_cache || strcmp(artist, last_artist.name) != 0 )
- {
- insert_container(artist, MUSIC_ARTIST_ID, NULL, "person.musicArtist", NULL, genre, NULL, &objectID, &parentID);
-- sprintf(last_artist.parentID, MUSIC_ARTIST_ID"$%"PRIX64, parentID);
-+ sprintf(last_artist.parentID, MUSIC_ARTIST_ID"$%"PRIX64, (int64_t)parentID);
- strcpy(last_artist.name, artist);
- last_artistAlbum.name[0] = '\0';
- /* Add this file to the "- All Albums -" container as well */
- insert_container(_("- All Albums -"), last_artist.parentID, NULL, "album", artist, genre, NULL, &objectID, &parentID);
-- sprintf(last_artistAlbumAll.parentID, "%s$%"PRIX64, last_artist.parentID, parentID);
-+ sprintf(last_artistAlbumAll.parentID, "%s$%"PRIX64, last_artist.parentID, (int64_t)parentID);
- last_artistAlbumAll.objectID = objectID;
- }
- else
-@@ -294,7 +295,7 @@ insert_containers(const char * name, const char *path, const char * refID, const
- {
- insert_container(album?album:_("Unknown Album"), last_artist.parentID, album?last_album.parentID:NULL,
- "album.musicAlbum", artist, genre, album_art, &objectID, &parentID);
-- sprintf(last_artistAlbum.parentID, "%s$%"PRIX64, last_artist.parentID, parentID);
-+ sprintf(last_artistAlbum.parentID, "%s$%"PRIX64, last_artist.parentID, (int64_t)parentID);
- last_artistAlbum.objectID = objectID;
- strcpy(last_artistAlbum.name, album?album:_("Unknown Album"));
- //DEBUG DPRINTF(E_DEBUG, L_SCANNER, "Creating cached artist/album item: %s/%s/%X\n", last_artist.name, last_artist.parentID, last_artist.objectID);
-@@ -315,12 +316,12 @@ insert_containers(const char * name, const char *path, const char * refID, const
- if( !valid_cache || strcmp(genre, last_genre.name) != 0 )
- {
- insert_container(genre, MUSIC_GENRE_ID, NULL, "genre.musicGenre", NULL, NULL, NULL, &objectID, &parentID);
-- sprintf(last_genre.parentID, MUSIC_GENRE_ID"$%"PRIX64, parentID);
-+ sprintf(last_genre.parentID, MUSIC_GENRE_ID"$%"PRIX64, (int64_t)parentID);
- strcpy(last_genre.name, genre);
- last_genreArtist.name[0] = '\0';
- /* Add this file to the "- All Artists -" container as well */
- insert_container(_("- All Artists -"), last_genre.parentID, NULL, "person", NULL, genre, NULL, &objectID, &parentID);
-- sprintf(last_genreArtistAll.parentID, "%s$%"PRIX64, last_genre.parentID, parentID);
-+ sprintf(last_genreArtistAll.parentID, "%s$%"PRIX64, last_genre.parentID, (int64_t)parentID);
- last_genreArtistAll.objectID = objectID;
- }
- else
-@@ -335,7 +336,7 @@ insert_containers(const char * name, const char *path, const char * refID, const
- {
- insert_container(artist?artist:_("Unknown Artist"), last_genre.parentID, artist?last_artist.parentID:NULL,
- "person.musicArtist", NULL, genre, NULL, &objectID, &parentID);
-- sprintf(last_genreArtist.parentID, "%s$%"PRIX64, last_genre.parentID, parentID);
-+ sprintf(last_genreArtist.parentID, "%s$%"PRIX64, last_genre.parentID, (int64_t)parentID);
- last_genreArtist.objectID = objectID;
- strcpy(last_genreArtist.name, artist?artist:_("Unknown Artist"));
- //DEBUG DPRINTF(E_DEBUG, L_SCANNER, "Creating cached genre/artist item: %s/%s/%X\n", last_genreArtist.name, last_genreArtist.parentID, last_genreArtist.objectID);
-@@ -659,7 +660,7 @@ sql_failed:
- return (ret != SQLITE_OK);
- }
-
--int
-+static int
- filter_audio(const struct dirent *d)
- {
- return ( (*d->d_name != '.') &&
-@@ -673,7 +674,7 @@ filter_audio(const struct dirent *d)
- ) ));
- }
-
--int
-+static int
- filter_video(const struct dirent *d)
- {
- return ( (*d->d_name != '.') &&
-@@ -685,7 +686,7 @@ filter_video(const struct dirent *d)
- ) );
- }
-
--int
-+static int
- filter_images(const struct dirent *d)
- {
- return ( (*d->d_name != '.') &&
-@@ -697,7 +698,7 @@ filter_images(const struct dirent *d)
- ) );
- }
-
--int
-+static int
- filter_media(const struct dirent *d)
- {
- return ( (*d->d_name != '.') &&
-@@ -713,7 +714,7 @@ filter_media(const struct dirent *d)
- ) ));
- }
-
--void
-+static void
- ScanDirectory(const char * dir, const char * parent, enum media_types dir_type)
- {
- struct dirent **namelist;
-@@ -804,7 +805,7 @@ ScanDirectory(const char * dir, const char * parent, enum media_types dir_type)
- }
-
- void
--start_scanner()
-+start_scanner(void)
- {
- struct media_dir_s * media_path = media_dirs;
- char name[PATH_MAX];
-diff --git scanner.h scanner.h
-index a57eedd..7eaa3a0 100644
---- scanner.h
-+++ scanner.h
-@@ -81,6 +81,6 @@ int
- CreateDatabase(void);
-
- void
--start_scanner();
-+start_scanner(void);
-
- #endif
-diff --git tagutils/tagutils-aac.c tagutils/tagutils-aac.c
-index 4224d5f..609710a 100644
---- tagutils/tagutils-aac.c
-+++ tagutils/tagutils-aac.c
-@@ -81,7 +81,7 @@ _get_aactags(char *file, struct song_metadata *psong)
- long atom_offset;
- unsigned int atom_length;
-
-- long current_offset = 0;
-+ unsigned int current_offset = 0;
- int current_size;
- char current_atom[4];
- char *current_data;
-@@ -119,7 +119,7 @@ _get_aactags(char *file, struct song_metadata *psong)
- current_data = (char*)malloc(len); // extra byte
- memset(current_data, 0x00, len);
-
-- if(fread(current_data, 1, current_size - 8, fin) != current_size - 8)
-+ if((int)fread(current_data, 1, current_size - 8, fin) != current_size - 8)
- break;
-
- if(!memcmp(current_atom, "\xA9" "nam", 4))
-@@ -243,7 +243,7 @@ _aac_lookforatom(FILE *aac_fp, char *atom_path, unsigned int *atom_length)
- return ftell(aac_fp) - 8;
- }
-
--int
-+static int
- _aac_check_extended_descriptor(FILE *infile)
- {
- short int i;
-diff --git tagutils/tagutils-asf.c tagutils/tagutils-asf.c
-index 11da1ae..abc5b78 100644
---- tagutils/tagutils-asf.c
-+++ tagutils/tagutils-asf.c
-@@ -23,7 +23,7 @@
- static int
- _asf_read_file_properties(FILE *fp, asf_file_properties_t *p, __u32 size)
- {
-- int len;
-+ unsigned int len;
-
- len = sizeof(*p) - offsetof(asf_file_properties_t, FileID);
- if(size < len)
-@@ -66,10 +66,10 @@ static int
- _asf_read_audio_stream(FILE *fp, struct song_metadata *psong, int size)
- {
- asf_audio_stream_t s;
-- int len;
-+ unsigned long len;
-
- len = sizeof(s) - sizeof(s.Hdr);
-- if(len > size)
-+ if(len > (unsigned long) size)
- len = size;
-
- if(len != fread(&s.wfx, 1, len, fp))
-@@ -90,7 +90,7 @@ _asf_read_media_stream(FILE *fp, struct song_metadata *psong, __u32 size)
- {
- asf_media_stream_t s;
- avi_audio_format_t wfx;
-- int len;
-+ unsigned int len;
-
- len = sizeof(s) - sizeof(s.Hdr);
- if(len > size)
-@@ -121,7 +121,7 @@ static int
- _asf_read_stream_object(FILE *fp, struct song_metadata *psong, __u32 size)
- {
- asf_stream_object_t s;
-- int len;
-+ unsigned int len;
-
- len = sizeof(s) - sizeof(asf_object_t);
- if(size < len)
-@@ -145,8 +145,8 @@ _asf_read_stream_object(FILE *fp, struct song_metadata *psong, __u32 size)
- static int
- _asf_read_extended_stream_object(FILE *fp, struct song_metadata *psong, __u32 size)
- {
-- int i, len;
-- long off;
-+ unsigned int i, len;
-+ size_t off;
- asf_object_t tmp;
- asf_extended_stream_object_t xs;
- asf_stream_name_t nm;
-@@ -201,7 +201,7 @@ static int
- _asf_read_header_extension(FILE *fp, struct song_metadata *psong, __u32 size)
- {
- off_t pos;
-- long off;
-+ size_t off;
- asf_header_extension_t ext;
- asf_object_t tmp;
-
-@@ -233,7 +233,7 @@ _asf_read_header_extension(FILE *fp, struct song_metadata *psong, __u32 size)
- }
-
- static int
--_asf_load_string(FILE *fp, int type, int size, char *buf, int len)
-+_asf_load_string(FILE *fp, int type, unsigned short size, char *buf, int len)
- {
- unsigned char data[2048];
- __u16 wc;
-@@ -302,7 +302,7 @@ _asf_load_string(FILE *fp, int type, int size, char *buf, int len)
- static void *
- _asf_load_picture(FILE *fp, int size, void *bm, int *bm_size)
- {
-- int i;
-+ unsigned long i;
- char buf[256];
- #if 0
- //
-diff --git tagutils/tagutils-flc.c tagutils/tagutils-flc.c
-index b8f41d4..839327f 100644
---- tagutils/tagutils-flc.c
-+++ tagutils/tagutils-flc.c
-@@ -26,7 +26,7 @@ _get_flctags(char *filename, struct song_metadata *psong)
- FLAC__Metadata_SimpleIterator *iterator = 0;
- FLAC__StreamMetadata *block;
- unsigned int sec, ms;
-- int i;
-+ unsigned int i;
- int err = 0;
-
- if(!(iterator = FLAC__metadata_simple_iterator_new()))
-diff --git tagutils/tagutils-mp3.c tagutils/tagutils-mp3.c
-index 770f231..698f743 100644
---- tagutils/tagutils-mp3.c
-+++ tagutils/tagutils-mp3.c
-@@ -31,7 +31,7 @@ _get_mp3tags(char *file, struct song_metadata *psong)
- struct id3_tag *pid3tag;
- struct id3_frame *pid3frame;
- int err;
-- int index;
-+ unsigned int index;
- int used;
- unsigned char *utf8_text;
- int genre = WINAMP_GENRE_UNKNOWN;
-@@ -405,7 +405,7 @@ static void _mp3_get_average_bitrate(FILE *infile, struct mp3_frameinfo *pfi, co
- off_t file_size;
- unsigned char frame_buffer[2900];
- unsigned char header[4];
-- int index = 0;
-+ unsigned int index = 0;
- int found = 0;
- off_t pos;
- struct mp3_frameinfo fi;
-@@ -549,11 +549,11 @@ _get_mp3fileinfo(char *file, struct song_metadata *psong)
- struct id3header *pid3;
- struct mp3_frameinfo fi;
- unsigned int size = 0;
-- unsigned int n_read;
-+ size_t n_read;
- off_t fp_size = 0;
- off_t file_size;
- unsigned char buffer[1024];
-- int index;
-+ unsigned int index;
-
- int xing_flags;
- int found;
-diff --git tagutils/tagutils-wav.c tagutils/tagutils-wav.c
-index e9f6c20..956eef7 100644
---- tagutils/tagutils-wav.c
-+++ tagutils/tagutils-wav.c
-@@ -79,7 +79,7 @@ _get_wavtags(char *filename, struct song_metadata *psong)
-
- /* now, walk through the chunks */
- current_offset = 12;
-- while(current_offset + 8 < psong->file_size)
-+ while(current_offset + 8 < (unsigned int) psong->file_size)
- {
- len = 8;
- if(!(len = read(fd, hdr, len)) || (len != 8))
-@@ -162,7 +162,7 @@ _get_wavtags(char *filename, struct song_metadata *psong)
-
- off = 4;
- p = tags + off;
-- while(off < len - 8)
-+ while(off < (int) len - 8)
- {
- taglen = GET_WAV_INT32(p + 4);
-
-diff --git tagutils/tagutils.c tagutils/tagutils.c
-index 7e147e7..b344552 100644
---- tagutils/tagutils.c
-+++ tagutils/tagutils.c
-@@ -96,7 +96,7 @@ char *winamp_genre[] = {
- "Unknown"
- };
-
--#define WINAMP_GENRE_UNKNOWN ((sizeof(winamp_genre) / sizeof(winamp_genre[0])) - 1)
-+#define WINAMP_GENRE_UNKNOWN ((int)(sizeof(winamp_genre) / sizeof(winamp_genre[0])) - 1)
-
-
- /*
-@@ -132,7 +132,7 @@ static taghandler taghandlers[] = {
- { "asf", 0, _get_asffileinfo },
- { "wav", _get_wavtags, _get_wavfileinfo },
- { "pcm", 0, _get_pcmfileinfo },
-- { NULL, 0 }
-+ { NULL, NULL, 0 }
- };
-
-
-diff --git upnpdescgen.c upnpdescgen.c
-index c3b94e0..2ce8c31 100644
---- upnpdescgen.c
-+++ upnpdescgen.c
-@@ -325,32 +325,32 @@ static const struct stateVar ConnectionManagerVars[] =
- {"SourceProtocolInfo", 1<<7, 0, 0, 44}, /* required */
- {"SinkProtocolInfo", 1<<7, 0, 0, 48}, /* required */
- {"CurrentConnectionIDs", 1<<7, 0, 0, 46}, /* required */
-- {"A_ARG_TYPE_ConnectionStatus", 0, 0, 27}, /* required */
-- {"A_ARG_TYPE_ConnectionManager", 0, 0}, /* required */
-- {"A_ARG_TYPE_Direction", 0, 0, 33}, /* required */
-- {"A_ARG_TYPE_ProtocolInfo", 0, 0}, /* required */
-- {"A_ARG_TYPE_ConnectionID", 4, 0}, /* required */
-- {"A_ARG_TYPE_AVTransportID", 4, 0}, /* required */
-- {"A_ARG_TYPE_RcsID", 4, 0}, /* required */
-- {0, 0}
-+ {"A_ARG_TYPE_ConnectionStatus", 0, 0, 27, 0}, /* required */
-+ {"A_ARG_TYPE_ConnectionManager", 0, 0, 0, 0}, /* required */
-+ {"A_ARG_TYPE_Direction", 0, 0, 33, 0}, /* required */
-+ {"A_ARG_TYPE_ProtocolInfo", 0, 0, 0, 0}, /* required */
-+ {"A_ARG_TYPE_ConnectionID", 4, 0, 0, 0}, /* required */
-+ {"A_ARG_TYPE_AVTransportID", 4, 0, 0, 0}, /* required */
-+ {"A_ARG_TYPE_RcsID", 4, 0, 0, 0}, /* required */
-+ {NULL, 0, 0, 0, 0}
- };
-
- static const struct argument GetSearchCapabilitiesArgs[] =
- {
- {"SearchCaps", 2, 10},
-- {0, 0}
-+ {NULL, 0, 0}
- };
-
- static const struct argument GetSortCapabilitiesArgs[] =
- {
- {"SortCaps", 2, 11},
-- {0, 0}
-+ {NULL, 0, 0}
- };
-
- static const struct argument GetSystemUpdateIDArgs[] =
- {
- {"Id", 2, 12},
-- {0, 0}
-+ {NULL, 0, 0}
- };
-
- static const struct argument BrowseArgs[] =
-@@ -365,7 +365,7 @@ static const struct argument BrowseArgs[] =
- {"NumberReturned", 2, 8},
- {"TotalMatches", 2, 8},
- {"UpdateID", 2, 9},
-- {0, 0}
-+ {NULL, 0, 0}
- };
-
- static const struct argument SearchArgs[] =
-@@ -380,7 +380,7 @@ static const struct argument SearchArgs[] =
- {"NumberReturned", 2, 8},
- {"TotalMatches", 2, 8},
- {"UpdateID", 2, 9},
-- {0, 0}
-+ {NULL, 0, 0}
- };
-
- static const struct action ContentDirectoryActions[] =
-@@ -407,16 +407,16 @@ static const struct action ContentDirectoryActions[] =
- static const struct stateVar ContentDirectoryVars[] =
- {
- {"TransferIDs", 1<<7, 0, 0, 48}, /* 0 */
-- {"A_ARG_TYPE_ObjectID", 0, 0},
-- {"A_ARG_TYPE_Result", 0, 0},
-- {"A_ARG_TYPE_SearchCriteria", 0, 0},
-- {"A_ARG_TYPE_BrowseFlag", 0, 0, 36},
-+ {"A_ARG_TYPE_ObjectID", 0, 0, 0, 0},
-+ {"A_ARG_TYPE_Result", 0, 0, 0, 0},
-+ {"A_ARG_TYPE_SearchCriteria", 0, 0, 0, 0},
-+ {"A_ARG_TYPE_BrowseFlag", 0, 0, 36, 0},
- /* Allowed Values : BrowseMetadata / BrowseDirectChildren */
-- {"A_ARG_TYPE_Filter", 0, 0}, /* 5 */
-- {"A_ARG_TYPE_SortCriteria", 0, 0},
-- {"A_ARG_TYPE_Index", 3, 0},
-- {"A_ARG_TYPE_Count", 3, 0},
-- {"A_ARG_TYPE_UpdateID", 3, 0},
-+ {"A_ARG_TYPE_Filter", 0, 0, 0, 0}, /* 5 */
-+ {"A_ARG_TYPE_SortCriteria", 0, 0, 0, 0},
-+ {"A_ARG_TYPE_Index", 3, 0, 0, 0},
-+ {"A_ARG_TYPE_Count", 3, 0, 0, 0},
-+ {"A_ARG_TYPE_UpdateID", 3, 0, 0, 0},
- //JM{"A_ARG_TYPE_TransferID", 3, 0}, /* 10 */
- //JM{"A_ARG_TYPE_TransferStatus", 0, 0, 39},
- /* Allowed Values : COMPLETED / ERROR / IN_PROGRESS / STOPPED */
-@@ -424,11 +424,11 @@ static const struct stateVar ContentDirectoryVars[] =
- //JM{"A_ARG_TYPE_TransferTotal", 0, 0},
- //JM{"A_ARG_TYPE_TagValueList", 0, 0},
- //JM{"A_ARG_TYPE_URI", 5, 0}, /* 15 */
-- {"SearchCapabilities", 0, 0},
-- {"SortCapabilities", 0, 0},
-+ {"SearchCapabilities", 0, 0, 0, 0},
-+ {"SortCapabilities", 0, 0, 0, 0},
- {"SystemUpdateID", 3|0x80, 0, 0, 255},
- //{"ContainerUpdateIDs", 0, 0},
-- {0, 0}
-+ {NULL, 0, 0, 0, 0}
- };
-
- static const struct argument GetIsAuthorizedArgs[] =
-@@ -464,15 +464,15 @@ static const struct action X_MS_MediaReceiverRegistrarActions[] =
-
- static const struct stateVar X_MS_MediaReceiverRegistrarVars[] =
- {
-- {"A_ARG_TYPE_DeviceID", 0, 0},
-- {"A_ARG_TYPE_RegistrationReqMsg", 7, 0},
-- {"A_ARG_TYPE_RegistrationRespMsg", 7, 0},
-- {"A_ARG_TYPE_Result", 6, 0},
-- {"AuthorizationDeniedUpdateID", 3, 0},
-- {"AuthorizationGrantedUpdateID", 3, 0},
-- {"ValidationRevokedUpdateID", 3, 0},
-- {"ValidationSucceededUpdateID", 3, 0},
-- {0, 0}
-+ {"A_ARG_TYPE_DeviceID", 0, 0, 0, 0},
-+ {"A_ARG_TYPE_RegistrationReqMsg", 7, 0, 0, 0},
-+ {"A_ARG_TYPE_RegistrationRespMsg", 7, 0, 0, 0},
-+ {"A_ARG_TYPE_Result", 6, 0, 0, 0},
-+ {"AuthorizationDeniedUpdateID", 3, 0, 0, 0},
-+ {"AuthorizationGrantedUpdateID", 3, 0, 0, 0},
-+ {"ValidationRevokedUpdateID", 3, 0, 0, 0},
-+ {"ValidationSucceededUpdateID", 3, 0, 0, 0},
-+ {NULL, 0, 0, 0, 0}
- };
-
- /* WANCfg.xml */
-diff --git upnpevents.c upnpevents.c
-index 1b5f018..2438bf3 100644
---- upnpevents.c
-+++ upnpevents.c
-@@ -256,7 +256,7 @@ error:
- static void
- upnp_event_notify_connect(struct upnp_event_notify * obj)
- {
-- int i;
-+ unsigned long i;
- const char * p;
- unsigned short port;
- struct sockaddr_in addr;
-diff --git upnphttp.c upnphttp.c
-index b368cd9..58f3f2c 100644
---- upnphttp.c
-+++ upnphttp.c
-@@ -1283,7 +1283,7 @@ SendResp_upnphttp(struct upnphttp * h)
- }
- }
-
--int
-+static int
- send_data(struct upnphttp * h, char * header, size_t size, int flags)
- {
- int n;
-@@ -1853,7 +1853,7 @@ SendResp_dlnafile(struct upnphttp * h, char * object)
- char path[PATH_MAX];
- char mime[32];
- char dlna[96];
-- } last_file = { 0, 0 };
-+ } last_file = { 0, 0, { '\0' }, { '\0' }, { '\0' } };
- #if USE_FORK
- pid_t newpid = 0;
- #endif
-diff --git upnpsoap.c upnpsoap.c
-index 3182ca4..ae4ff95 100644
---- upnpsoap.c
-+++ upnpsoap.c
-@@ -542,7 +542,7 @@ set_filter_flags(char * filter, struct upnphttp *h)
- return flags;
- }
-
--char *
-+static char *
- parse_sort_criteria(char *sortCriteria, int *error)
- {
- char *order = NULL;
-diff --git utils.c utils.c
-index d8cba4d..36ff168 100644
---- utils.c
-+++ utils.c
-@@ -19,7 +19,11 @@
- #include <ctype.h>
- #include <string.h>
- #include <stdlib.h>
-+#if defined(__FreeBSD__)
-+#include <limits.h>
-+#else
- #include <linux/limits.h>
-+#endif
- #include <sys/stat.h>
- #include <unistd.h>
- #include <sys/types.h>
-@@ -30,6 +34,7 @@
- #include "minidlnatypes.h"
- #include "upnpglobalvars.h"
- #include "log.h"
-+#include "utils.h"
-
- inline int
- strcatf(struct string_s *str, const char *fmt, ...)
-@@ -277,7 +282,7 @@ unsigned int
- DJBHash(const char *str, int len)
- {
- unsigned int hash = 5381;
-- unsigned int i = 0;
-+ int i = 0;
-
- for(i = 0; i < len; str++, i++)
- {
-diff --git utils.h utils.h
-index fbd0a91..b5b433a 100644
---- utils.h
-+++ utils.h
-@@ -25,7 +25,11 @@
- #define __UTILS_H__
-
- int
--strcatf(struct string_s *str, char *fmt, ...);
-+strcatf(struct string_s *str, const char *fmt, ...)
-+#ifdef __GNUC__
-+ __attribute__((format(printf, 2, 3)))
-+#endif
-+;
-
- void
- strncpyt(char *dst, const char *src, size_t len);
-diff --git uuid.c uuid.c
-index bdb4abc..bfa22b7 100644
---- uuid.c
-+++ uuid.c
-@@ -37,6 +37,7 @@
-
- #include "getifaddr.h"
- #include "log.h"
-+#include "uuid.h"
-
- #define ETH_ALEN 6
- #define NSEC_PER_SEC 1000000000L
-@@ -106,7 +107,7 @@ read_random_bytes(unsigned char *buf, size_t size)
- }
- }
-
--void
-+static void
- init_clockseq(void)
- {
- unsigned char buf[4];
-@@ -117,7 +118,7 @@ init_clockseq(void)
- clock_seq_initialized = 1;
- }
-
--int
-+static int
- generate_uuid(unsigned char uuid_out[16])
- {
- static u_int64_t last_time_all;
-
diff --git a/net/minidlna/files/scandir-patch b/net/minidlna/files/scandir-patch
deleted file mode 100644
index 161c6063e5a2..000000000000
--- a/net/minidlna/files/scandir-patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- scanner.c 17 Nov 2009 19:13:00 -0000 1.53
-+++ scanner.c 9 Jan 2010 13:19:49 -0000
-@@ -632,4 +636,4 @@
--filter_audio(const struct dirent *d)
-+filter_audio(struct dirent *d)
- {
- return ( (*d->d_name != '.') &&
- ((d->d_type == DT_DIR) ||
-@@ -644,4 +648,4 @@
--filter_video(const struct dirent *d)
-+filter_video(struct dirent *d)
- {
- return ( (*d->d_name != '.') &&
- ((d->d_type == DT_DIR) ||
-@@ -656,4 +660,4 @@
--filter_images(const struct dirent *d)
-+filter_images(struct dirent *d)
- {
- return ( (*d->d_name != '.') &&
- ((d->d_type == DT_DIR) ||
-@@ -668,4 +672,4 @@
--filter_media(const struct dirent *d)
-+filter_media(struct dirent *d)
- {
- return ( (*d->d_name != '.') &&
- ((d->d_type == DT_DIR) ||