Skip to content

Commit

Permalink
1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
philippe44 committed Dec 26, 2023
1 parent 5241c58 commit 37c5657
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 16 deletions.
Binary file renamed AirConnect-1.6.0.zip → AirConnect-1.6.1.zip
Binary file not shown.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.6.1
- be more relax wrt player deletion and verify with either failed doc download (airupnp) or no response to ping (aircast)

1.6.0
- (airupnp) remove possibility to tweak ProtocolInfo, it's useless
- only send silence on first GET (after a flush) and close socket on flush
Expand Down
14 changes: 11 additions & 3 deletions aircast/src/aircast.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,14 @@ static void UpdateDevices() {
for (int i = 0; i < glMaxDevices; i++) {
struct sMR *Device = glMRDevices + i;
if (Device->Running && Device->Remove && !CastIsConnected(Device->CastCtx)) {
LOG_INFO("[%p]: removing renderer (%s) %d", Device, Device->Config.Name);
raopsr_delete(Device->Raop);
RemoveCastDevice(Device);
struct in_addr addr = CastGetAddr(glMRDevices[i].CastCtx);
if (!ping_host(addr, 100)) {
LOG_INFO("[%p]: removing renderer (%s) %d", Device, Device->Config.Name);
raopsr_delete(Device->Raop);
RemoveCastDevice(Device);
} else {
LOG_DEBUG("[%p]: %s mute to mDNS search, but answers ping, so keep it", Device, Device->Config.Name);
}
}
}

Expand Down Expand Up @@ -468,6 +473,9 @@ static bool mDNSsearchCallback(mdnssd_service_t *slist, void *cookie, bool *stop
}
}
}
if (Device->Remove && ping_host(s->addr, 100)) {
LOG_INFO("[%p]: %s mute to mDNS search, but answers ping, so keep it", Device, Device->Config.Name);
}
// device update - when playing ChromeCast update their TXT records
} else {
char *Name = GetmDNSAttribute(s->attr, s->attr_count, "fn");
Expand Down
2 changes: 1 addition & 1 deletion aircast/src/aircast.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "raop_server.h"
#include "cast_util.h"

#define VERSION "v1.6.0"" ("__DATE__" @ "__TIME__")"
#define VERSION "v1.6.1"" ("__DATE__" @ "__TIME__")"

/*----------------------------------------------------------------------------*/
/* typedefs */
Expand Down
25 changes: 16 additions & 9 deletions airupnp/src/airupnp.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,15 +699,22 @@ static void *UpdateThread(void *args) {

for (int i = 0; i < glMaxDevices; i++) {
Device = glMRDevices + i;
if (Device->Running && (((Device->State != PLAYING || Device->RaopState != RAOP_PLAY) &&
(now - Device->LastSeen > PRESENCE_TIMEOUT || Device->ErrorCount > MAX_ACTION_ERRORS)) ||
Device->ErrorCount < 0)) {

pthread_mutex_lock(&Device->Mutex);
LOG_INFO("[%p]: removing unresponsive player (%s)", Device, Device->Config.Name);
raopsr_delete(Device->Raop);
// device's mutex returns unlocked
DelMRDevice(Device);
if (Device->Running && (Device->ErrorCount < 0 || Device->ErrorCount > MAX_ACTION_ERRORS ||
(Device->State == STOPPED && now - Device->LastSeen > PRESENCE_TIMEOUT))) {
// if device does not answer, try to download its DescDoc
IXML_Document* DescDoc = NULL;
if (UpnpDownloadXmlDoc(Update->Data, &DescDoc) != UPNP_E_SUCCESS) {
pthread_mutex_lock(&Device->Mutex);
LOG_INFO("[%p]: removing unresponsive player (%s)", Device, Device->Config.Name);
raopsr_delete(Device->Raop);
// device's mutex returns unlocked
DelMRDevice(Device);
} else {
// device is in trouble, but let's renew grace period
Device->LastSeen = now;
LOG_INFO("[%p]: %s mute to discovery, but answers UPnP, so keep it", Device, Device->Config.Name);
}
if (DescDoc) ixmlDocument_free(DescDoc);
}
}

Expand Down
2 changes: 1 addition & 1 deletion airupnp/src/airupnp.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "cross_util.h"
#include "metadata.h"

#define VERSION "v1.6.0"" ("__DATE__" @ "__TIME__")"
#define VERSION "v1.6.1"" ("__DATE__" @ "__TIME__")"

/*----------------------------------------------------------------------------*/
/* typedefs */
Expand Down
2 changes: 1 addition & 1 deletion common/crosstools

0 comments on commit 37c5657

Please sign in to comment.