From 47bd255ffcde055a255bd3b5e2c96fe7899002fa Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Sat, 17 Jul 2010 08:05:06 +0200 Subject: [PATCH] Do not add AirTunes devices that don't support AirTunes v2 Filter based on the tp field of the mDNS TXT record. --- src/player.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/player.c b/src/player.c index 53cb3fd9..c95c2609 100644 --- a/src/player.c +++ b/src/player.c @@ -2849,6 +2849,34 @@ raop_device_cb(const char *name, const char *type, const char *domain, const cha } else { + p = avahi_string_list_find(txt, "tp"); + if (!p) + { + DPRINTF(E_LOG, L_PLAYER, "AirTunes %s: no tp field in TXT record!\n", name); + + return; + } + + avahi_string_list_get_pair(p, &key, &val, &valsz); + avahi_free(key); + if (!val) + { + DPRINTF(E_LOG, L_PLAYER, "AirTunes %s: tp has no value\n", name); + + return; + } + + if (!strstr(val, "UDP")) + { + DPRINTF(E_LOG, L_PLAYER, "AirTunes %s: device does not support AirTunes v2 (tp=%s), discarding\n", name, val); + + avahi_free(val); + return; + } + + avahi_free(val); + val = NULL; + p = avahi_string_list_find(txt, "pw"); if (!p) {