From fce68ebd1a5c7e6cfce01ff9016d13b39028a161 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Sun, 12 Mar 2017 22:11:56 +0100 Subject: [PATCH] [raop] Add option to exclude particular devices from speaker list --- forked-daapd.conf.in | 4 ++++ src/conffile.c | 1 + src/outputs/raop.c | 8 ++++++++ 3 files changed, 13 insertions(+) diff --git a/forked-daapd.conf.in b/forked-daapd.conf.in index d3bb93e6..6c19a196 100644 --- a/forked-daapd.conf.in +++ b/forked-daapd.conf.in @@ -202,6 +202,10 @@ audio { # you can set a lower value here # max_volume = 11 + # Enable this option to exclude a particular AirPlay device from the + # speaker list +# exclude = false + # AirPlay password # password = "s1kr3t" #} diff --git a/src/conffile.c b/src/conffile.c index cd46b632..6f7e571b 100644 --- a/src/conffile.c +++ b/src/conffile.c @@ -109,6 +109,7 @@ static cfg_opt_t sec_audio[] = static cfg_opt_t sec_airplay[] = { CFG_INT("max_volume", 11, CFGF_NONE), + CFG_BOOL("exclude", cfg_false, CFGF_NONE), CFG_STR("password", NULL, CFGF_NONE), CFG_END() }; diff --git a/src/outputs/raop.c b/src/outputs/raop.c index a9627d47..807cd645 100644 --- a/src/outputs/raop.c +++ b/src/outputs/raop.c @@ -4009,6 +4009,14 @@ raop_device_cb(const char *name, const char *type, const char *domain, const cha DPRINTF(E_DBG, L_RAOP, "Event for AirPlay device %s (port %d, id %" PRIx64 ")\n", at_name, port, id); + airplay = cfg_gettsec(cfg, "airplay", at_name); + if (airplay && cfg_getbool(airplay, "exclude")) + { + DPRINTF(E_LOG, L_RAOP, "Excluding AirPlay device '%s' as set in config\n", at_name); + + return; + } + rd = calloc(1, sizeof(struct output_device)); if (!rd) {