[cast] Use friendly device name from mdns announcement

This commit is contained in:
ejurgensen 2017-02-10 19:27:52 +01:00
parent d2fe608c72
commit 13e6889990

View File

@ -1229,6 +1229,7 @@ static void
cast_device_cb(const char *name, const char *type, const char *domain, const char *hostname, int family, const char *address, int port, struct keyval *txt)
{
struct output_device *device;
const char *friendly_name;
uint32_t id;
id = djb_hash(name, strlen(name));
@ -1238,6 +1239,10 @@ cast_device_cb(const char *name, const char *type, const char *domain, const cha
return;
}
friendly_name = keyval_get(txt, "fn");
if (friendly_name)
name = friendly_name;
DPRINTF(E_DBG, L_CAST, "Event for Chromecast device '%s' (port %d, id %" PRIu32 ")\n", name, port, id);
device = calloc(1, sizeof(struct output_device));