Browse Source

squeezelite: Bump to 1.9.1-1130

Signed-off-by: Robert Högberg <robert.hogberg@gmail.com>
lilik-openwrt-22.03
Robert Högberg 6 years ago
parent
commit
453d016057
6 changed files with 123 additions and 295 deletions
  1. +21
    -24
      sound/squeezelite/Makefile
  2. +0
    -56
      sound/squeezelite/patches/005-respect_LDFLAGS.patch
  3. +62
    -61
      sound/squeezelite/patches/010-select_broadcast_interface.patch
  4. +40
    -35
      sound/squeezelite/patches/020-no_libmad.patch
  5. +0
    -14
      sound/squeezelite/patches/030-fix_musl_compatibilty.patch
  6. +0
    -105
      sound/squeezelite/patches/040-clear_dynlink_errors.patch

+ 21
- 24
sound/squeezelite/Makefile View File

@ -6,8 +6,8 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=squeezelite PKG_NAME:=squeezelite
PKG_VERSION:=1.8.4-743
PKG_RELEASE=2
PKG_VERSION:=1.9.1-1130
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0 PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=LICENSE.txt PKG_LICENSE_FILES:=LICENSE.txt
@ -16,9 +16,9 @@ PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/ralph-irving/squeezelite.git PKG_SOURCE_URL:=https://github.com/ralph-irving/squeezelite.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=e37ed17fed9e11a7346cbe9f1e1deeccc051f42e
PKG_SOURCE_VERSION:=451cad8da651073d18118fb9ca39faef550825ff
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=b6ea4a11366330790f5e36bd875b45bb19a9772dfc984c462f436dfca30256c0
PKG_MIRROR_HASH:=e6082b486e364c8cbd7db96fc06dc5243242a3ac786113e42e3061c06ea8889e
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
@ -82,52 +82,49 @@ define Package/squeezelite-mini/config
endef endef
define Package/squeezelite/description/default define Package/squeezelite/description/default
Squeezelite is a small headless squeezebox emulator for linux using alsa audio output
It is aimed at supporting high quality audio at multiple sample rates including
44.1/48/88.2/96/176.4/192k/352.8/384kHz
Supported codecs: mp3, flac, ogg, aac, (wma and alac via ffmpeg)
Squeezelite is a small headless squeezebox emulator for linux using alsa audio output
It is aimed at supporting high quality audio at multiple sample rates including
44.1/48/88.2/96/176.4/192k/352.8/384kHz
Supported codecs: mp3, flac, ogg, aac, (wma and alac via ffmpeg)
Native support for PCM builtin Native support for PCM builtin
Optional support of DSD playback via PCM for DoP capable DAC Optional support of DSD playback via PCM for DoP capable DAC
Optional resampling to match sound device Optional resampling to match sound device
endef endef
define Package/squeezelite/description
define Package/squeezelite-full/description
$(call Package/squeezelite/description/default) $(call Package/squeezelite/description/default)
.
This package has all the audio codecs compiled in. This package has all the audio codecs compiled in.
endef endef
define Package/squeezelite-mini/description define Package/squeezelite-mini/description
$(call Package/squeezelite/description/default) $(call Package/squeezelite/description/default)
.
This package will dynamically load installed codecs. This package will dynamically load installed codecs.
endef endef
#ifeq ($(CONFIG_SQUEEZELITE_WMA),y)
# PKG_BUILD_DEPENDS+= libffmpeg-audio-dec
#endif
TARGET_CFLAGS+= -Wall -fPIC -O2 -DSELFPIPE
ifeq ($(CONFIG_SQUEEZELITE_WMA),y) ifeq ($(CONFIG_SQUEEZELITE_WMA),y)
TARGET_CFLAGS+= -DFFMPEG
opts+= -DFFMPEG
endif endif
ifeq ($(CONFIG_SQUEEZELITE_DSD),y) ifeq ($(CONFIG_SQUEEZELITE_DSD),y)
TARGET_CFLAGS+= -DDSD
opts+= -DDSD
endif endif
ifeq ($(CONFIG_SQUEEZELITE_RESAMPLE),y) ifeq ($(CONFIG_SQUEEZELITE_RESAMPLE),y)
TARGET_CFLAGS+= -DRESAMPLE
opts+= -DRESAMPLE
endif endif
TARGET_LDFLAGS+= -lasound -lpthread -lm -lrt
ifeq ($(BUILD_VARIANT),full) ifeq ($(BUILD_VARIANT),full)
TARGET_CFLAGS+= -DLINKALL
TARGET_LDFLAGS+= -lvorbis -logg
opts+= -DLINKALL
endif endif
MAKE_FLAGS+=OPTS="$(opts)"
# Squeezelite uses functions which are deprecated in recent ffmpeg versions.
# See https://github.com/ralph-irving/squeezelite/issues/60
TARGET_CFLAGS+=-Wno-deprecated-declarations
define Package/squeezelite/install define Package/squeezelite/install
$(INSTALL_DIR) $(1)/usr/bin $(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/squeezelite $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/squeezelite $(1)/usr/bin


+ 0
- 56
sound/squeezelite/patches/005-respect_LDFLAGS.patch View File

@ -1,56 +0,0 @@
From 1c53ed7db5b49ebf347efe65dbf9b740f9d54557 Mon Sep 17 00:00:00 2001
From: Carlo Landmeter <clandmeter@gmail.com>
Date: Tue, 31 Mar 2015 09:52:53 +0000
Subject: [PATCH] respect LDFLAGS
---
Makefile | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
# Cross compile support - create a Makefile which defines these three variables and then includes this Makefile...
-CFLAGS ?= -Wall -fPIC -O2 $(OPTS)
-LDFLAGS ?= -lasound -lpthread -lm -lrt
+CFLAGS ?= -Wall -O2
+CFLAGS += -fPIC $(OPTS)
+LIBS ?= -lasound -lpthread -lm -lrt
EXECUTABLE ?= squeezelite
# passing one or more of these in $(OPTS) enables optional feature inclusion
@@ -52,20 +53,20 @@ endif
# add optional link options
ifneq (,$(findstring $(OPT_LINKALL), $(CFLAGS)))
- LDFLAGS += $(LINKALL)
+ LIBS += $(LINKALL)
ifneq (,$(findstring $(OPT_FF), $(CFLAGS)))
- LDFLAGS += $(LINKALL_FF)
+ LIBS += $(LINKALL_FF)
endif
ifneq (,$(findstring $(OPT_RESAMPLE), $(CFLAGS)))
- LDFLAGS += $(LINKALL_RESAMPLE)
+ LIBS += $(LINKALL_RESAMPLE)
endif
ifneq (,$(findstring $(OPT_IR), $(CFLAGS)))
- LDFLAGS += $(LINKALL_IR)
+ LIBS += $(LINKALL_IR)
endif
else
# if not LINKALL and linux add LINK_LINUX
ifeq ($(UNAME), Linux)
- LDFLAGS += $(LINK_LINUX)
+ LIBS += $(LINK_LINUX)
endif
endif
@@ -74,7 +75,7 @@ OBJECTS = $(SOURCES:.c=.o)
all: $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
- $(CC) $(OBJECTS) $(LDFLAGS) -o $@
+ $(CC) $(OBJECTS) $(LDFLAGS) $(LIBS) -o $@
$(OBJECTS): $(DEPS)

+ 62
- 61
sound/squeezelite/patches/010-select_broadcast_interface.patch View File

@ -1,15 +1,17 @@
--- a/main.c
+++ b/main.c
@@ -78,6 +78,7 @@ static void usage(const char *argv0) {
Index: squeezelite-1.9.1-1130/main.c
===================================================================
--- squeezelite-1.9.1-1130.orig/main.c
+++ squeezelite-1.9.1-1130/main.c
@@ -84,6 +84,7 @@ static void usage(const char *argv0) {
#if IR #if IR
" -i [<filename>]\tEnable lirc remote control support (lirc config file ~/.lircrc used if filename not specified)\n" " -i [<filename>]\tEnable lirc remote control support (lirc config file ~/.lircrc used if filename not specified)\n"
#endif #endif
+ " -I <interface>\t\tNetwork interface used to send discovery\n"
+ " -I <interface>\tNetwork interface used to send discovery\n"
" -m <mac addr>\t\tSet mac address, format: ab:cd:ef:12:34:56\n" " -m <mac addr>\t\tSet mac address, format: ab:cd:ef:12:34:56\n"
" -M <modelname>\tSet the squeezelite player model name sent to the server (default: " MODEL_NAME_STRING ")\n" " -M <modelname>\tSet the squeezelite player model name sent to the server (default: " MODEL_NAME_STRING ")\n"
" -n <name>\t\tSet the player name\n" " -n <name>\t\tSet the player name\n"
@@ -233,6 +234,8 @@ int main(int argc, char **argv) {
extern bool pcm_check_header;
@@ -267,6 +268,8 @@ int main(int argc, char **argv) {
extern bool user_rates;
char *logfile = NULL; char *logfile = NULL;
u8_t mac[6]; u8_t mac[6];
+ char *iface = NULL; + char *iface = NULL;
@ -17,7 +19,7 @@
unsigned stream_buf_size = STREAMBUF_SIZE; unsigned stream_buf_size = STREAMBUF_SIZE;
unsigned output_buf_size = 0; // set later unsigned output_buf_size = 0; // set later
unsigned rates[MAX_SUPPORTED_SAMPLERATES] = { 0 }; unsigned rates[MAX_SUPPORTED_SAMPLERATES] = { 0 };
@@ -271,6 +274,7 @@ int main(int argc, char **argv) {
@@ -307,6 +310,7 @@ int main(int argc, char **argv) {
int maxSampleRate = 0; int maxSampleRate = 0;
@ -25,7 +27,7 @@
char *optarg = NULL; char *optarg = NULL;
int optind = 1; int optind = 1;
int i; int i;
@@ -278,8 +282,6 @@ int main(int argc, char **argv) {
@@ -314,8 +318,6 @@ int main(int argc, char **argv) {
#define MAXCMDLINE 512 #define MAXCMDLINE 512
char cmdline[MAXCMDLINE] = ""; char cmdline[MAXCMDLINE] = "";
@ -34,16 +36,16 @@
for (i = 0; i < argc && (strlen(argv[i]) + strlen(cmdline) + 2 < MAXCMDLINE); i++) { for (i = 0; i < argc && (strlen(argv[i]) + strlen(cmdline) + 2 < MAXCMDLINE); i++) {
strcat(cmdline, argv[i]); strcat(cmdline, argv[i]);
strcat(cmdline, " "); strcat(cmdline, " ");
@@ -287,7 +289,7 @@ int main(int argc, char **argv) {
@@ -323,7 +325,7 @@ int main(int argc, char **argv) {
while (optind < argc && strlen(argv[optind]) >= 2 && argv[optind][0] == '-') { while (optind < argc && strlen(argv[optind]) >= 2 && argv[optind][0] == '-') {
char *opt = argv[optind] + 1; char *opt = argv[optind] + 1;
- if (strstr("oabcCdefmMnNpPrs" - if (strstr("oabcCdefmMnNpPrs"
+ if (strstr("oabcCdefImMnNpPrs" + if (strstr("oabcCdefImMnNpPrs"
#if ALSA #if ALSA
"UV"
"UVO"
#endif #endif
@@ -382,6 +384,9 @@ int main(int argc, char **argv) {
@@ -424,6 +426,9 @@ int main(int argc, char **argv) {
case 'f': case 'f':
logfile = optarg; logfile = optarg;
break; break;
@ -53,7 +55,7 @@
case 'm': case 'm':
{ {
int byte = 0; int byte = 0;
@@ -667,6 +672,11 @@ int main(int argc, char **argv) {
@@ -733,6 +738,11 @@ int main(int argc, char **argv) {
winsock_init(); winsock_init();
#endif #endif
@ -65,7 +67,7 @@
stream_init(log_stream, stream_buf_size); stream_init(log_stream, stream_buf_size);
if (!strcmp(output_device, "-")) { if (!strcmp(output_device, "-")) {
@@ -710,7 +720,7 @@ int main(int argc, char **argv) {
@@ -776,7 +786,7 @@ int main(int argc, char **argv) {
exit(1); exit(1);
} }
@ -74,9 +76,11 @@
decode_close(); decode_close();
stream_close(); stream_close();
--- a/squeezelite.h
+++ b/squeezelite.h
@@ -403,7 +403,7 @@ typedef enum { EVENT_TIMEOUT = 0, EVENT_
Index: squeezelite-1.9.1-1130/squeezelite.h
===================================================================
--- squeezelite-1.9.1-1130.orig/squeezelite.h
+++ squeezelite-1.9.1-1130/squeezelite.h
@@ -414,7 +414,7 @@ typedef enum { EVENT_TIMEOUT = 0, EVENT_
char *next_param(char *src, char c); char *next_param(char *src, char c);
u32_t gettime_ms(void); u32_t gettime_ms(void);
@ -85,7 +89,7 @@
void set_nonblock(sockfd s); void set_nonblock(sockfd s);
int connect_timeout(sockfd sock, const struct sockaddr *addr, socklen_t addrlen, int timeout); int connect_timeout(sockfd sock, const struct sockaddr *addr, socklen_t addrlen, int timeout);
void server_addr(char *server, in_addr_t *ip_ptr, unsigned *port_ptr); void server_addr(char *server, in_addr_t *ip_ptr, unsigned *port_ptr);
@@ -459,7 +459,7 @@ void buf_init(struct buffer *buf, size_t
@@ -470,7 +470,7 @@ void buf_init(struct buffer *buf, size_t
void buf_destroy(struct buffer *buf); void buf_destroy(struct buffer *buf);
// slimproto.c // slimproto.c
@ -94,9 +98,11 @@
void slimproto_stop(void); void slimproto_stop(void);
void wake_controller(void); void wake_controller(void);
--- a/slimproto.c
+++ b/slimproto.c
@@ -119,7 +119,7 @@ void send_packet(u8_t *packet, size_t le
Index: squeezelite-1.9.1-1130/slimproto.c
===================================================================
--- squeezelite-1.9.1-1130.orig/slimproto.c
+++ squeezelite-1.9.1-1130/slimproto.c
@@ -113,7 +113,7 @@ void send_packet(u8_t *packet, size_t le
} }
} }
@ -105,16 +111,16 @@
const char *base_cap = "Model=squeezelite,AccuratePlayPoints=1,HasDigitalOut=1,HasPolarityInversion=1,Firmware=" VERSION; const char *base_cap = "Model=squeezelite,AccuratePlayPoints=1,HasDigitalOut=1,HasPolarityInversion=1,Firmware=" VERSION;
struct HELO_packet pkt; struct HELO_packet pkt;
@@ -782,7 +782,7 @@ void wake_controller(void) {
@@ -757,7 +757,7 @@ void wake_controller(void) {
wake_signal(wake_e); wake_signal(wake_e);
} }
-in_addr_t discover_server(void) {
+in_addr_t discover_server(in_addr_t bcast_addr) {
-in_addr_t discover_server(char *default_server) {
+in_addr_t discover_server(char *default_server, in_addr_t bcast_addr) {
struct sockaddr_in d; struct sockaddr_in d;
struct sockaddr_in s; struct sockaddr_in s;
char *buf; char *buf;
@@ -798,7 +798,7 @@ in_addr_t discover_server(void) {
@@ -774,7 +774,7 @@ in_addr_t discover_server(char *default_
memset(&d, 0, sizeof(d)); memset(&d, 0, sizeof(d));
d.sin_family = AF_INET; d.sin_family = AF_INET;
d.sin_port = htons(PORT); d.sin_port = htons(PORT);
@ -123,7 +129,7 @@
pollinfo.fd = disc_sock; pollinfo.fd = disc_sock;
pollinfo.events = POLLIN; pollinfo.events = POLLIN;
@@ -829,7 +829,7 @@ in_addr_t discover_server(void) {
@@ -809,7 +809,7 @@ in_addr_t discover_server(char *default_
#define FIXED_CAP_LEN 256 #define FIXED_CAP_LEN 256
#define VAR_CAP_LEN 128 #define VAR_CAP_LEN 128
@ -132,26 +138,28 @@
struct sockaddr_in serv_addr; struct sockaddr_in serv_addr;
static char fixed_cap[FIXED_CAP_LEN], var_cap[VAR_CAP_LEN] = ""; static char fixed_cap[FIXED_CAP_LEN], var_cap[VAR_CAP_LEN] = "";
bool reconnect = false; bool reconnect = false;
@@ -849,7 +849,7 @@ void slimproto(log_level level, char *se
@@ -830,7 +830,7 @@ void slimproto(log_level level, char *se
} }
if (!slimproto_ip) { if (!slimproto_ip) {
- slimproto_ip = discover_server();
+ slimproto_ip = discover_server(bcast_addr);
- slimproto_ip = discover_server(server);
+ slimproto_ip = discover_server(server, bcast_addr);
} }
if (!slimproto_port) { if (!slimproto_port) {
@@ -924,7 +924,7 @@ void slimproto(log_level level, char *se
@@ -911,7 +911,7 @@ void slimproto(log_level level, char *se
// rediscover server if it was not set at startup // rediscover server if it was not set at startup
if (!server && ++failed_connect > 5) { if (!server && ++failed_connect > 5) {
- slimproto_ip = serv_addr.sin_addr.s_addr = discover_server();
+ slimproto_ip = serv_addr.sin_addr.s_addr = discover_server(bcast_addr);
- slimproto_ip = serv_addr.sin_addr.s_addr = discover_server(NULL);
+ slimproto_ip = serv_addr.sin_addr.s_addr = discover_server(NULL, bcast_addr);
} }
} else { } else {
--- a/utils.c
+++ b/utils.c
Index: squeezelite-1.9.1-1130/utils.c
===================================================================
--- squeezelite-1.9.1-1130.orig/utils.c
+++ squeezelite-1.9.1-1130/utils.c
@@ -22,11 +22,11 @@ @@ -22,11 +22,11 @@
#include "squeezelite.h" #include "squeezelite.h"
@ -185,7 +193,7 @@
// logging functions // logging functions
const char *logtime(void) { const char *logtime(void) {
static char buf[100]; static char buf[100];
@@ -114,58 +110,101 @@ u32_t gettime_ms(void) {
@@ -114,58 +110,94 @@ u32_t gettime_ms(void) {
#endif #endif
} }
@ -224,17 +232,16 @@
+ loglevel = level; + loglevel = level;
+ +
+ // Check for non-zero MAC + // Check for non-zero MAC
+ if ((mac[0] | mac[1] | mac[2]) != 0)
+ if (mac[0] | mac[1] | mac[2] != 0)
+ have_mac = 1; + have_mac = 1;
+ +
+ // Copy interface name, if it was provided.
+ if (iface != NULL)
+ {
+ if( strlen(iface) > sizeof(ifname) )
+ return -1;
+ strncpy(ifname, iface, sizeof(ifname));
+ have_ifname = 1;
+ // Copy interface name, if it was provided.
+ if (iface != NULL) {
+ if (strlen(iface) > sizeof(ifname))
+ return -1;
+ strncpy(ifname, iface, sizeof(ifname));
+ have_ifname = 1;
} }
- mac[0] = mac[1] = mac[2] = mac[3] = mac[4] = mac[5] = 0; - mac[0] = mac[1] = mac[2] = mac[3] = mac[4] = mac[5] = 0;
@ -243,22 +250,19 @@
+ for (ifa = addrs; ifa; ifa = ifa->ifa_next) { + for (ifa = addrs; ifa; ifa = ifa->ifa_next) {
+ // Skip LOOPBACK interfaces, DOWN interfaces and interfaces that + // Skip LOOPBACK interfaces, DOWN interfaces and interfaces that
+ // don't support BROADCAST. + // don't support BROADCAST.
+ if ((ifa->ifa_flags & IFF_LOOPBACK)
+ || !(ifa->ifa_flags & IFF_UP)
+ || !(ifa->ifa_flags & IFF_BROADCAST))
+ {
+ if (ifa->ifa_flags & IFF_LOOPBACK
+ || !ifa->ifa_flags & IFF_UP
+ || !ifa->ifa_flags & IFF_BROADCAST) {
+ continue; + continue;
+ } + }
- int s = socket(AF_INET, SOCK_DGRAM, 0); - int s = socket(AF_INET, SOCK_DGRAM, 0);
+ if (!have_ifname)
+ {
+ if (!have_ifname) {
+ // We have found a valid interface name. Keep it. + // We have found a valid interface name. Keep it.
+ strncpy(ifname, ifa->ifa_name, sizeof(ifname)); + strncpy(ifname, ifa->ifa_name, sizeof(ifname));
+ have_ifname = 1; + have_ifname = 1;
+ } else { + } else {
+ if (strncmp(ifname, ifa->ifa_name, sizeof(ifname)) != 0)
+ {
+ if (strncmp(ifname, ifa->ifa_name, sizeof(ifname)) != 0) {
+ // This is not the interface we're looking for. + // This is not the interface we're looking for.
+ continue; + continue;
+ } + }
@ -270,20 +274,17 @@
- if (ioctl(s, SIOCGIFCONF, &ifc) == 0) { - if (ioctl(s, SIOCGIFCONF, &ifc) == 0) {
- ifend = ifs + (ifc.ifc_len / sizeof(struct ifreq)); - ifend = ifs + (ifc.ifc_len / sizeof(struct ifreq));
+ // Check address family. + // Check address family.
+ if ((ifa->ifa_addr->sa_family == AF_INET) &&
+ (((struct sockaddr_in *)ifa->ifa_broadaddr)->sin_addr.s_addr != 0))
+ {
+ if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET &&
+ ((struct sockaddr_in *)ifa->ifa_broadaddr)->sin_addr.s_addr != 0) {
+ // Get broadcast address and MAC address + // Get broadcast address and MAC address
+ bcast_addr = ((struct sockaddr_in *)ifa->ifa_broadaddr)->sin_addr.s_addr; + bcast_addr = ((struct sockaddr_in *)ifa->ifa_broadaddr)->sin_addr.s_addr;
+ break; + break;
+ } + }
+ else
+ {
+ else {
+ // Address is not IPv4 + // Address is not IPv4
+ if (iface == NULL) + if (iface == NULL)
+ have_ifname = 0; + have_ifname = 0;
+ } + }
+
+ } + }
- for (ifr = ifc.ifc_req; ifr < ifend; ifr++) { - for (ifr = ifc.ifc_req; ifr < ifend; ifr++) {
@ -296,10 +297,10 @@
- break; - break;
- } - }
+ // Find MAC address matching interface + // Find MAC address matching interface
+ if (!have_mac && (bcast_addr != 0)) {
+ if (!have_mac && bcast_addr != 0) {
+ for (ifa = addrs; ifa; ifa = ifa->ifa_next) { + for (ifa = addrs; ifa; ifa = ifa->ifa_next) {
+ if ((ifa->ifa_addr->sa_family == PF_PACKET) &&
+ (strncmp(ifname, ifa->ifa_name, sizeof(ifname)) == 0)) {
+ if (ifa->ifa_addr && ifa->ifa_addr->sa_family == PF_PACKET &&
+ strncmp(ifname, ifa->ifa_name, sizeof(ifname)) == 0) {
+ sdl = (struct sockaddr *)(ifa->ifa_addr); + sdl = (struct sockaddr *)(ifa->ifa_addr);
+ ptr = (unsigned char *)sdl->sa_data; + ptr = (unsigned char *)sdl->sa_data;
+ memcpy(mac, ptr + 10, 6); + memcpy(mac, ptr + 10, 6);
@ -323,7 +324,7 @@
#if SUN #if SUN
void get_mac(u8_t mac[]) { void get_mac(u8_t mac[]) {
struct arpreq parpreq; struct arpreq parpreq;
@@ -232,30 +271,6 @@ void get_mac(u8_t mac[]) {
@@ -232,30 +264,6 @@ void get_mac(u8_t mac[]) {
} }
#endif #endif


+ 40
- 35
sound/squeezelite/patches/020-no_libmad.patch View File

@ -1,83 +1,88 @@
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ OPT_IR = -DIR
Index: squeezelite-1.9.1-1130/Makefile
===================================================================
--- squeezelite-1.9.1-1130.orig/Makefile
+++ squeezelite-1.9.1-1130/Makefile
@@ -17,7 +17,7 @@ OPT_NO_FAAD = -DNO_FAAD
SOURCES = \ SOURCES = \
main.c slimproto.c buffer.c stream.c utils.c \ main.c slimproto.c buffer.c stream.c utils.c \
output.c output_alsa.c output_pa.c output_stdout.c output_pack.c decode.c \ output.c output_alsa.c output_pa.c output_stdout.c output_pack.c decode.c \
- flac.c pcm.c mad.c vorbis.c faad.c mpg.c
+ flac.c pcm.c vorbis.c faad.c mpg.c
- flac.c pcm.c mad.c vorbis.c mpg.c
+ flac.c pcm.c vorbis.c mpg.c
SOURCES_DSD = dsd.c dop.c dsd2pcm/dsd2pcm.c SOURCES_DSD = dsd.c dop.c dsd2pcm/dsd2pcm.c
SOURCES_FF = ffmpeg.c SOURCES_FF = ffmpeg.c
@@ -25,7 +25,7 @@ SOURCES_IR = ir.c
@@ -30,7 +30,7 @@ SOURCES_FAAD = faad.c
LINK_LINUX = -ldl LINK_LINUX = -ldl
LINK_RPI = -lwiringPi
-LINKALL = -lFLAC -lmad -lvorbisfile -lfaad -lmpg123
+LINKALL = -lFLAC -lvorbisfile -lfaad -lmpg123
-LINKALL = -lFLAC -lmad -lvorbisfile -lmpg123
+LINKALL = -lFLAC -lvorbisfile -lmpg123
LINKALL_FF = -lavcodec -lavformat -lavutil LINKALL_FF = -lavcodec -lavformat -lavutil
LINKALL_RESAMPLE = -lsoxr LINKALL_RESAMPLE = -lsoxr
LINKALL_IR = -llirc_client LINKALL_IR = -llirc_client
--- a/decode.c
+++ b/decode.c
@@ -145,8 +145,8 @@ void decode_init(log_level level, const
if (!strstr(exclude_codecs, "pcm") && (!include_codecs || strstr(include_codecs, "pcm"))) codecs[i++] = register_pcm();
Index: squeezelite-1.9.1-1130/decode.c
===================================================================
--- squeezelite-1.9.1-1130.orig/decode.c
+++ squeezelite-1.9.1-1130/decode.c
@@ -176,11 +176,7 @@ void decode_init(log_level level, const
if (!strstr(exclude_codecs, "pcm") && (!include_codecs || (order_codecs = strstr(include_codecs, "pcm"))))
sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_pcm());
// try mad then mpg for mp3 unless command line option passed
- // try mad then mpg for mp3 unless command line option passed
- if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mad")) && - if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mad")) &&
- (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mad"))) codecs[i] = register_mad();
+// if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mad")) &&
+// (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mad"))) codecs[i] = register_mad();
if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mpg")) && !codecs[i] &&
(!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mpg"))) codecs[i] = register_mpg();
- (!include_codecs || (order_codecs = strstr(include_codecs, "mp3")) || (order_codecs = strstr(include_codecs, "mad"))))
- sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_mad());
- else if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mpg")) &&
+ if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mpg")) &&
(!include_codecs || (order_codecs = strstr(include_codecs, "mp3")) || (order_codecs = strstr(include_codecs, "mpg"))))
sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_mpg());
--- a/main.c
+++ b/main.c
@@ -39,7 +39,8 @@
Index: squeezelite-1.9.1-1130/main.c
===================================================================
--- squeezelite-1.9.1-1130.orig/main.c
+++ squeezelite-1.9.1-1130/main.c
@@ -44,7 +44,7 @@
#else #else
#define CODECS_DSD "" #define CODECS_DSD ""
#endif #endif
-#define CODECS_MP3 " (mad,mpg for specific mp3 codec)" -#define CODECS_MP3 " (mad,mpg for specific mp3 codec)"
+//#define CODECS_MP3 " (mad,mpg for specific mp3 codec)"
+#define CODECS_MP3 " (mpg123 for specific mp3 codec)"
+#define CODECS_MP3 ""
#define CODECS CODECS_BASE CODECS_FF CODECS_DSD CODECS_MP3
#define CODECS CODECS_BASE CODECS_AAC CODECS_FF CODECS_DSD CODECS_MP3
--- a/squeezelite.h
+++ b/squeezelite.h
@@ -154,7 +154,7 @@
Index: squeezelite-1.9.1-1130/squeezelite.h
===================================================================
--- squeezelite-1.9.1-1130.orig/squeezelite.h
+++ squeezelite-1.9.1-1130/squeezelite.h
@@ -163,7 +163,6 @@
#if LINUX #if LINUX
#define LIBFLAC "libFLAC.so.8" #define LIBFLAC "libFLAC.so.8"
-#define LIBMAD "libmad.so.0" -#define LIBMAD "libmad.so.0"
+//#define LIBMAD "libmad.so.0"
#define LIBMPG "libmpg123.so.0" #define LIBMPG "libmpg123.so.0"
#define LIBVORBIS "libvorbisfile.so.3" #define LIBVORBIS "libvorbisfile.so.3"
#define LIBTREMOR "libvorbisidec.so.1" #define LIBTREMOR "libvorbisidec.so.1"
@@ -168,7 +168,7 @@
@@ -177,7 +176,6 @@
#if OSX #if OSX
#define LIBFLAC "libFLAC.8.dylib" #define LIBFLAC "libFLAC.8.dylib"
-#define LIBMAD "libmad.0.dylib" -#define LIBMAD "libmad.0.dylib"
+//#define LIBMAD "libmad.0.dylib"
#define LIBMPG "libmpg123.0.dylib" #define LIBMPG "libmpg123.0.dylib"
#define LIBVORBIS "libvorbisfile.3.dylib" #define LIBVORBIS "libvorbisfile.3.dylib"
#define LIBTREMOR "libvorbisidec.1.dylib" #define LIBTREMOR "libvorbisidec.1.dylib"
@@ -181,7 +181,7 @@
@@ -190,7 +188,6 @@
#if WIN #if WIN
#define LIBFLAC "libFLAC.dll" #define LIBFLAC "libFLAC.dll"
-#define LIBMAD "libmad-0.dll" -#define LIBMAD "libmad-0.dll"
+//#define LIBMAD "libmad-0.dll"
#define LIBMPG "libmpg123-0.dll" #define LIBMPG "libmpg123-0.dll"
#define LIBVORBIS "libvorbisfile.dll" #define LIBVORBIS "libvorbisfile.dll"
#define LIBTREMOR "libvorbisidec.dll" #define LIBTREMOR "libvorbisidec.dll"
@@ -194,7 +194,7 @@
@@ -203,7 +200,6 @@
#if FREEBSD #if FREEBSD
#define LIBFLAC "libFLAC.so.11" #define LIBFLAC "libFLAC.so.11"
-#define LIBMAD "libmad.so.2" -#define LIBMAD "libmad.so.2"
+//#define LIBMAD "libmad.so.2"
#define LIBMPG "libmpg123.so.0" #define LIBMPG "libmpg123.so.0"
#define LIBVORBIS "libvorbisfile.so.6" #define LIBVORBIS "libvorbisfile.so.6"
#define LIBTREMOR "libvorbisidec.so.1" #define LIBTREMOR "libvorbisidec.so.1"

+ 0
- 14
sound/squeezelite/patches/030-fix_musl_compatibilty.patch View File

@ -1,14 +0,0 @@
--- a/output_alsa.c
+++ b/output_alsa.c
@@ -911,8 +911,11 @@ void output_init_alsa(log_level level, c
LOG_INFO("memory locked");
}
+#ifdef M_TRIM_THRESHOLD
+ // mallopt is not defined in musl libc
mallopt(M_TRIM_THRESHOLD, -1);
mallopt(M_MMAP_MAX, 0);
+#endif
touch_memory(silencebuf, MAX_SILENCE_FRAMES * BYTES_PER_FRAME);
touch_memory(outputbuf->buf, outputbuf->size);

+ 0
- 105
sound/squeezelite/patches/040-clear_dynlink_errors.patch View File

@ -1,105 +0,0 @@
--- a/faad.c
+++ b/faad.c
@@ -594,6 +594,8 @@ static bool load_faad() {
return false;
}
+ err = dlerror(); // Reset previous dynamic linking error string (if there was)
+
a->NeAACDecGetCurrentConfiguration = dlsym(handle, "NeAACDecGetCurrentConfiguration");
a->NeAACDecSetConfiguration = dlsym(handle, "NeAACDecSetConfiguration");
a->NeAACDecOpen = dlsym(handle, "NeAACDecOpen");
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -620,6 +620,8 @@ static bool load_ff() {
return false;
}
+ err = dlerror(); // Reset previous dynamic linking error string (if there was)
+
sprintf(name, LIBAVFORMAT, LIBAVFORMAT_VERSION_MAJOR);
handle_format = dlopen(name, RTLD_NOW);
if (!handle_format) {
--- a/flac.c
+++ b/flac.c
@@ -241,6 +241,8 @@ static bool load_flac() {
return false;
}
+ err = dlerror(); // Reset previous dynamic linking error string (if there was)
+
f->FLAC__StreamDecoderErrorStatusString = dlsym(handle, "FLAC__StreamDecoderErrorStatusString");
f->FLAC__StreamDecoderStateString = dlsym(handle, "FLAC__StreamDecoderStateString");
f->FLAC__stream_decoder_new = dlsym(handle, "FLAC__stream_decoder_new");
--- a/ir.c
+++ b/ir.c
@@ -168,10 +168,10 @@ static void *ir_thread() {
UNLOCK_I;
wake_controller();
}
-
+
free(code);
}
-
+
return 0;
}
@@ -185,6 +185,8 @@ static bool load_lirc() {
return false;
}
+ err = dlerror(); // Reset previous dynamic linking error string (if there was)
+
i->lirc_init = dlsym(handle, "lirc_init");
i->lirc_deinit = dlsym(handle, "lirc_deinit");
i->lirc_readconfig = dlsym(handle, "lirc_readconfig");
--- a/mad.c
+++ b/mad.c
@@ -365,7 +365,9 @@ static bool load_mad() {
LOG_INFO("dlerror: %s", dlerror());
return false;
}
-
+
+ err = dlerror(); // Reset previous dynamic linking error string (if there was)
+
m->mad_stream_init = dlsym(handle, "mad_stream_init");
m->mad_frame_init = dlsym(handle, "mad_frame_init");
m->mad_synth_init = dlsym(handle, "mad_synth_init");
--- a/mpg.c
+++ b/mpg.c
@@ -222,7 +222,9 @@ static bool load_mpg() {
LOG_INFO("dlerror: %s", dlerror());
return false;
}
-
+
+ err = dlerror(); // Reset previous dynamic linking error string (if there was)
+
m->mpg123_init = dlsym(handle, "mpg123_init");
m->mpg123_feature = dlsym(handle, "mpg123_feature");
m->mpg123_rates = dlsym(handle, "mpg123_rates");
--- a/resample.c
+++ b/resample.c
@@ -251,6 +251,8 @@ static bool load_soxr(void) {
return false;
}
+ err = dlerror(); // Reset previous dynamic linking error string (if there was)
+
r->soxr_io_spec = dlsym(handle, "soxr_io_spec");
r->soxr_quality_spec = dlsym(handle, "soxr_quality_spec");
r->soxr_create = dlsym(handle, "soxr_create");
--- a/vorbis.c
+++ b/vorbis.c
@@ -287,6 +287,8 @@ static bool load_vorbis() {
}
}
+ err = dlerror(); // Reset previous dynamic linking error string (if there was)
+
v->ov_read = tremor ? NULL : dlsym(handle, "ov_read");
v->ov_read_tremor = tremor ? dlsym(handle, "ov_read") : NULL;
v->ov_info = dlsym(handle, "ov_info");

Loading…
Cancel
Save