Skip to content

Commit 37c5657

Browse files
committed
1.6.1
1 parent 5241c58 commit 37c5657

File tree

8 files changed

+34
-16
lines changed

8 files changed

+34
-16
lines changed
Binary file not shown.

CHANGELOG

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
1.6.1
2+
- be more relax wrt player deletion and verify with either failed doc download (airupnp) or no response to ping (aircast)
3+
14
1.6.0
25
- (airupnp) remove possibility to tweak ProtocolInfo, it's useless
36
- only send silence on first GET (after a flush) and close socket on flush

aircast/src/aircast.c

+11-3
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,14 @@ static void UpdateDevices() {
394394
for (int i = 0; i < glMaxDevices; i++) {
395395
struct sMR *Device = glMRDevices + i;
396396
if (Device->Running && Device->Remove && !CastIsConnected(Device->CastCtx)) {
397-
LOG_INFO("[%p]: removing renderer (%s) %d", Device, Device->Config.Name);
398-
raopsr_delete(Device->Raop);
399-
RemoveCastDevice(Device);
397+
struct in_addr addr = CastGetAddr(glMRDevices[i].CastCtx);
398+
if (!ping_host(addr, 100)) {
399+
LOG_INFO("[%p]: removing renderer (%s) %d", Device, Device->Config.Name);
400+
raopsr_delete(Device->Raop);
401+
RemoveCastDevice(Device);
402+
} else {
403+
LOG_DEBUG("[%p]: %s mute to mDNS search, but answers ping, so keep it", Device, Device->Config.Name);
404+
}
400405
}
401406
}
402407

@@ -468,6 +473,9 @@ static bool mDNSsearchCallback(mdnssd_service_t *slist, void *cookie, bool *stop
468473
}
469474
}
470475
}
476+
if (Device->Remove && ping_host(s->addr, 100)) {
477+
LOG_INFO("[%p]: %s mute to mDNS search, but answers ping, so keep it", Device, Device->Config.Name);
478+
}
471479
// device update - when playing ChromeCast update their TXT records
472480
} else {
473481
char *Name = GetmDNSAttribute(s->attr, s->attr_count, "fn");

aircast/src/aircast.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "raop_server.h"
1919
#include "cast_util.h"
2020

21-
#define VERSION "v1.6.0"" ("__DATE__" @ "__TIME__")"
21+
#define VERSION "v1.6.1"" ("__DATE__" @ "__TIME__")"
2222

2323
/*----------------------------------------------------------------------------*/
2424
/* typedefs */

airupnp/src/airupnp.c

+16-9
Original file line numberDiff line numberDiff line change
@@ -699,15 +699,22 @@ static void *UpdateThread(void *args) {
699699

700700
for (int i = 0; i < glMaxDevices; i++) {
701701
Device = glMRDevices + i;
702-
if (Device->Running && (((Device->State != PLAYING || Device->RaopState != RAOP_PLAY) &&
703-
(now - Device->LastSeen > PRESENCE_TIMEOUT || Device->ErrorCount > MAX_ACTION_ERRORS)) ||
704-
Device->ErrorCount < 0)) {
705-
706-
pthread_mutex_lock(&Device->Mutex);
707-
LOG_INFO("[%p]: removing unresponsive player (%s)", Device, Device->Config.Name);
708-
raopsr_delete(Device->Raop);
709-
// device's mutex returns unlocked
710-
DelMRDevice(Device);
702+
if (Device->Running && (Device->ErrorCount < 0 || Device->ErrorCount > MAX_ACTION_ERRORS ||
703+
(Device->State == STOPPED && now - Device->LastSeen > PRESENCE_TIMEOUT))) {
704+
// if device does not answer, try to download its DescDoc
705+
IXML_Document* DescDoc = NULL;
706+
if (UpnpDownloadXmlDoc(Update->Data, &DescDoc) != UPNP_E_SUCCESS) {
707+
pthread_mutex_lock(&Device->Mutex);
708+
LOG_INFO("[%p]: removing unresponsive player (%s)", Device, Device->Config.Name);
709+
raopsr_delete(Device->Raop);
710+
// device's mutex returns unlocked
711+
DelMRDevice(Device);
712+
} else {
713+
// device is in trouble, but let's renew grace period
714+
Device->LastSeen = now;
715+
LOG_INFO("[%p]: %s mute to discovery, but answers UPnP, so keep it", Device, Device->Config.Name);
716+
}
717+
if (DescDoc) ixmlDocument_free(DescDoc);
711718
}
712719
}
713720

airupnp/src/airupnp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "cross_util.h"
2222
#include "metadata.h"
2323

24-
#define VERSION "v1.6.0"" ("__DATE__" @ "__TIME__")"
24+
#define VERSION "v1.6.1"" ("__DATE__" @ "__TIME__")"
2525

2626
/*----------------------------------------------------------------------------*/
2727
/* typedefs */

0 commit comments

Comments
 (0)