Skip to content

Commit e9d740d

Browse files
Update codebase from upstream
1 parent b29bd72 commit e9d740d

File tree

27 files changed

+27
-10
lines changed

27 files changed

+27
-10
lines changed

CHANGELOG

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
2025-09-10
2+
- send keep-alive
3+
14
2023-12
2-
- raop_streamer: no content-length on chunked-encoding, even on range request
5+
-- raop_streamer: no content-length on chunked-encoding, even on range request

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ endif
44

55
ifeq ($(findstring gcc,$(CC)),gcc)
66
CFLAGS += -Wno-stringop-truncation -Wno-stringop-overflow -Wno-format-truncation -Wno-multichar
7-
LDFLAGS += -s -lstdc++
7+
LDFLAGS += -s -lstdc++ -latomic
88
else
99
CFLAGS += -fno-temp-file
1010
LDFLAGS += -lc++
@@ -19,7 +19,7 @@ BUILDDIR = $(dir $(CORE))$(HOST)/$(PLATFORM)
1919
LIB = lib/$(HOST)/$(PLATFORM)/libraop.a
2020
EXECUTABLE = $(CORE)-$(PLATFORM)
2121

22-
DEFINES = -DNDEBUG -D_GNU_SOURCE
22+
DEFINES = -DNDEBUG -D_GNU_SOURCE -DOPENSSL_SUPPRESS_DEPRECATED
2323
CFLAGS += -Wall -fPIC -ggdb -O2 $(DEFINES) -fdata-sections -ffunction-sections
2424
LDFLAGS += -lpthread -ldl -lm -L.
2525

crosstools

libcodecs

Submodule libcodecs updated 112 files

libopenssl

Submodule libopenssl updated 3588 files

libraop.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<ClCompile>
8080
<WarningLevel>Level3</WarningLevel>
8181
<SDLCheck>true</SDLCheck>
82-
<PreprocessorDefinitions>FLAC__NO_DLL;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
82+
<PreprocessorDefinitions>FLAC__NO_DLL;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;WIN32;OPENSSL_SUPPRESS_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
8383
<AdditionalIncludeDirectories>crosstools\src;dmap-parser;libmdns\targets\include\mdnssvc;libmdns\targets\include\mdnssd;libcodecs\targets\include\faac;libcodecs\targets\include\flac;libcodecs\targets\include\shine;libcodecs\targets\include\addons;libpthreads4w\targets\win32\x86\include;libopenssl\targets\win32\x86\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
8484
<ConformanceMode>true</ConformanceMode>
8585
<DisableSpecificWarnings>4267;4244;5105</DisableSpecificWarnings>

src/raop_client.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ typedef struct {
130130
typedef struct raopcl_s {
131131
struct rtspcl_s *rtspcl;
132132
raop_state_t state;
133+
uint64_t last_keepalive; // Track last keepalive time
133134
char DACP_id[17], active_remote[11];
134135
struct {
135136
unsigned int ctrl, time;
@@ -675,6 +676,7 @@ struct raopcl_s *raopcl_create(struct in_addr host, uint16_t port_base, uint16_t
675676
raopcld = malloc(sizeof(raopcl_data_t));
676677
memset(raopcld, 0, sizeof(raopcl_data_t));
677678

679+
raopcld->last_keepalive = raopcl_get_ntp(NULL); // Initialize last keepalive time
678680
// raopcld->sane is set to 0
679681
raopcld->port_base = port_base;
680682
raopcld->port_range = port_base ? port_range : 1;
@@ -749,7 +751,6 @@ static void _raopcl_terminate_rtp(struct raopcl_s *p)
749751
bool raopcl_set_volume(struct raopcl_s *p, float vol)
750752
{
751753
char a[128];
752-
753754
if (!p) return false;
754755

755756
if ((vol < -30 || vol > 0) && vol != -144.0) return false;
@@ -1136,6 +1137,7 @@ bool _raopcl_disconnect(struct raopcl_s *p, bool force)
11361137

11371138
pthread_mutex_lock(&p->mutex);
11381139
p->state = RAOP_DOWN;
1140+
p->last_keepalive = raopcl_get_ntp(NULL);
11391141
pthread_mutex_unlock(&p->mutex);
11401142

11411143
_raopcl_terminate_rtp(p);
@@ -1359,6 +1361,14 @@ void *_rtp_control_thread(void *args)
13591361
while (raopcld->ctrl_running) {
13601362
struct timeval timeout = { 1, 0 };
13611363
fd_set rfds;
1364+
uint64_t now = raopcl_get_ntp(NULL);
1365+
1366+
// Send keepalive packet every 25 seconds
1367+
if (now - raopcld->last_keepalive >= MS2NTP(25000)) {
1368+
LOG_INFO("[%p]: sending keepalive packet", raopcld);
1369+
raopcl_keepalive(raopcld);
1370+
raopcld->last_keepalive = now;
1371+
}
13621372

13631373
FD_ZERO(&rfds);
13641374
FD_SET(raopcld->rtp_ports.ctrl.fd, &rfds);

src/rtsp_client.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,12 @@ static bool exec_request(struct rtspcl_s *rtspcld, char *cmd, char *content_type
659659

660660
token = strtok(line, delimiters);
661661
token = strtok(NULL, delimiters);
662+
663+
// ignore 501 when
662664
if (token == NULL || strcmp(token, "200")) {
663-
LOG_ERROR("[%p]: <------ : request failed, error %s", rtspcld, line);
665+
if (strcmp(token, "501") || strcmp(cmd, "OPTIONS")) {
666+
LOG_ERROR("[%p]: <------ : request failed, error %s %s", rtspcld, line, (token ? token : ""));
667+
}
664668
if (get_response == 1) return false;
665669
} else {
666670
LOG_DEBUG("[%p]: <------ : %s: request ok", rtspcld, token);

targets/freebsd/x86_64/libraop.a

1.25 KB
Binary file not shown.

0 commit comments

Comments
 (0)