Skip to content

Commit

Permalink
1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
philippe44 committed Dec 26, 2023
1 parent 8bc0afd commit 3b3c275
Show file tree
Hide file tree
Showing 37 changed files with 24 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Note: beware of crypto version (see shairtunes)

1.5.3
- when player don't respond to mDNS search, keep them as long as they respond to ping

1.5.2
- invert 'f' stream_disconnect() and flush test order

Expand Down
2 changes: 1 addition & 1 deletion application/crosstools
2 changes: 1 addition & 1 deletion application/squeeze2raop/inc/squeezedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#pragma once

#define VERSION "v1.5.2"" ("__DATE__" @ "__TIME__")"
#define VERSION "v1.5.3"" ("__DATE__" @ "__TIME__")"

#define STR_LEN 256

Expand Down
19 changes: 13 additions & 6 deletions application/squeeze2raop/squeeze2raop.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,18 @@ static void UpdateDevices() {
// walk through the list for device whose timeout expired
for (int i = 0; i < MAX_RENDERERS; i++) {
struct sMR* Device = glMRDevices + i;
if (!Device->Running || Device->Config.RemoveTimeout <= 0 || !Device->Expired || now < Device->Expired + Device->Config.RemoveTimeout * 1000) continue;
if (!Device->Running || Device->Config.RemoveTimeout <= 0 || !Device->Expired ||
now < Device->Expired + Device->Config.RemoveTimeout * 1000) continue;

LOG_INFO("[%p]: removing renderer (%s) on timeout", Device, Device->FriendlyName);
if (Device->SqueezeHandle) sq_delete_device(Device->SqueezeHandle);
DelRaopDevice(Device);
if (!ping_host(Device->PlayerIP, 100)) {
LOG_INFO("[%p]: removing renderer (%s) on timeout", Device, Device->FriendlyName);
if (Device->SqueezeHandle) sq_delete_device(Device->SqueezeHandle);
DelRaopDevice(Device);
} else {
// device is in trouble, but let's renew grace period
Device->Expired = now | 0x01;
LOG_INFO("[%p]: %s mute to mDNS search, but answers ping, so keep it", Device, Device->FriendlyName);
}
}

pthread_mutex_unlock(&glMainMutex);
Expand All @@ -665,13 +672,13 @@ static bool mDNSsearchCallback(mdnssd_service_t *slist, void *cookie, bool *stop
Device->Expired = 0;
// device disconnected
if (s->expired) {
if (!raopcl_is_connected(Device->Raop) && !Device->Config.RemoveTimeout) {
if (!raopcl_is_connected(Device->Raop) && !Device->Config.RemoveTimeout && !ping_host(s->addr, 100)) {
LOG_INFO("[%p]: removing renderer (%s)", Device, Device->FriendlyName);
if (Device->SqueezeHandle) sq_delete_device(Device->SqueezeHandle);
DelRaopDevice(Device);
} else {
LOG_INFO("[%p]: keep missing renderer (%s)", Device, Device->FriendlyName);
Device->Expired = now ? now : 1;
Device->Expired = now | 0x01;
}
// device update - ignore changes in TXT
} else if (s->port != Device->PlayerPort || s->addr.s_addr != Device->PlayerIP.s_addr) {
Expand Down
Loading

0 comments on commit 3b3c275

Please sign in to comment.