[cast] Add option to exclude speakers (closes #659)

This commit is contained in:
ejurgensen
2019-01-09 20:26:31 +01:00
parent 275c1cd563
commit 741825d086
3 changed files with 24 additions and 0 deletions

View File

@@ -1245,6 +1245,7 @@ cast_device_cb(const char *name, const char *type, const char *domain, const cha
{
struct output_device *device;
const char *friendly_name;
cfg_t *chromecast;
uint32_t id;
id = djb_hash(name, strlen(name));
@@ -1260,6 +1261,13 @@ cast_device_cb(const char *name, const char *type, const char *domain, const cha
DPRINTF(E_DBG, L_CAST, "Event for Chromecast device '%s' (port %d, id %" PRIu32 ")\n", name, port, id);
chromecast = cfg_gettsec(cfg, "chromecast", name);
if (chromecast && cfg_getbool(chromecast, "exclude"))
{
DPRINTF(E_LOG, L_CAST, "Excluding Chromecast device '%s' as set in config\n", name);
return;
}
device = calloc(1, sizeof(struct output_device));
if (!device)
{