Look out for AppleTV and flag the device for unencrypted streaming

The AppleTV has been reported as not using the encryption. Not actually
tested as I don't have an AppleTV to test with.
This commit is contained in:
Julien BLACHE 2010-07-30 18:53:13 +02:00
parent f5bcc82afb
commit 9cb4aaa921

View File

@ -2766,6 +2766,7 @@ raop_device_cb(const char *name, const char *type, const char *domain, const cha
uint64_t id;
size_t valsz;
int has_password;
int encrypt;
int ret;
ret = safe_hextou64(name, &id);
@ -2911,6 +2912,30 @@ raop_device_cb(const char *name, const char *type, const char *domain, const cha
DPRINTF(E_LOG, L_PLAYER, "No password given in config for AirTunes device %s\n", name);
}
encrypt = 1;
p = avahi_string_list_find(txt, "am");
if (!p)
{
DPRINTF(E_LOG, L_PLAYER, "AirTunes %s: no am field in TXT record!\n", name);
goto no_ma;
}
avahi_string_list_get_pair(p, &key, &val, &valsz);
avahi_free(key);
if (!val)
{
DPRINTF(E_LOG, L_PLAYER, "AirTunes %s: am has no value\n", name);
goto no_ma;
}
if (strncmp(val, "AppleTV", strlen("AppleTV")) == 0)
encrypt = 0;
avahi_free(val);
no_ma:
pthread_mutex_lock(&dev_lck);
for (rd = dev_list; rd; rd = rd->next)
@ -2983,7 +3008,7 @@ raop_device_cb(const char *name, const char *type, const char *domain, const cha
rd->name = strdup(at_name);
rd->encrypt = 1;
rd->encrypt = encrypt;
rd->has_password = has_password;
rd->password = password;