Obey device "md" (metadata) tag - credit @couteau

- original patch https://gist.github.com/couteau/7532531
This commit is contained in:
ejurgensen 2013-11-23 11:25:30 +01:00
parent 9760a43ccf
commit 1199a459ac
3 changed files with 23 additions and 4 deletions

View File

@ -3716,6 +3716,7 @@ raop_device_cb(const char *name, const char *type, const char *domain, const cha
char *at_name;
char *password;
uint64_t id;
char wants_metadata;
char has_password;
enum raop_devtype devtype;
int ret;
@ -3850,6 +3851,25 @@ raop_device_cb(const char *name, const char *type, const char *domain, const cha
devtype = OTHER;
no_am:
wants_metadata = 0;
p = keyval_get(txt, "md");
if (!p)
{
DPRINTF(E_LOG, L_PLAYER, "AirTunes %s: no md field in TXT record!\n", name);
goto no_md;
}
if (*p == '\0')
{
DPRINTF(E_LOG, L_PLAYER, "AirTunes %s: md has no value\n", name);
goto no_md;
}
wants_metadata = 1;
no_md:
DPRINTF(E_DBG, L_PLAYER, "AirTunes device %s: password: %s, type %s\n", name, (password) ? "yes" : "no", raop_devtype[devtype]);
rd->advertised = 1;
@ -3869,6 +3889,7 @@ raop_device_cb(const char *name, const char *type, const char *domain, const cha
rd->devtype = devtype;
rd->wants_metadata = wants_metadata;
rd->has_password = has_password;
rd->password = password;

View File

@ -1848,31 +1848,28 @@ raop_session_make(struct raop_device *rd, int family, raop_status_cb cb)
rs->server_fd = -1;
rs->password = rd->password;
rs->wants_metadata = rd->wants_metadata;
switch (rd->devtype)
{
case RAOP_DEV_APEX_80211G:
rs->encrypt = 1;
rs->auth_quirk_itunes = 1;
rs->wants_metadata = 0;
break;
case RAOP_DEV_APEX_80211N:
rs->encrypt = 1;
rs->auth_quirk_itunes = 0;
rs->wants_metadata = 0;
break;
case RAOP_DEV_APPLETV:
rs->encrypt = 0;
rs->auth_quirk_itunes = 0;
rs->wants_metadata = 1;
break;
case OTHER:
rs->encrypt = 0;
rs->auth_quirk_itunes = 0;
rs->wants_metadata = 0;
break;
}

View File

@ -40,6 +40,7 @@ struct raop_device
unsigned selected:1;
unsigned advertised:1;
unsigned wants_metadata:1;
unsigned has_password:1;
const char *password;