mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 15:45:56 -05:00
Obey device "md" (metadata) tag - credit @couteau
- original patch https://gist.github.com/couteau/7532531
This commit is contained in:
parent
9760a43ccf
commit
1199a459ac
21
src/player.c
21
src/player.c
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,7 @@ struct raop_device
|
||||
unsigned selected:1;
|
||||
unsigned advertised:1;
|
||||
|
||||
unsigned wants_metadata:1;
|
||||
unsigned has_password:1;
|
||||
const char *password;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user