mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-23 19:17:46 -05:00
Adjust daapcache so it serves User-Agent to httpd_daap's reply handlers
This commit is contained in:
@@ -712,15 +712,17 @@ transcode_cleanup(struct transcode_ctx *ctx)
|
||||
|
||||
|
||||
int
|
||||
transcode_needed(struct evkeyvalq *headers, char *file_codectype)
|
||||
transcode_needed(const char *user_agent, const char *client_codecs, char *file_codectype)
|
||||
{
|
||||
const char *client_codecs;
|
||||
const char *user_agent;
|
||||
char *codectype;
|
||||
cfg_t *lib;
|
||||
int size;
|
||||
int i;
|
||||
|
||||
// If client is a Remote we will AirPlay, which means we will transcode to PCM
|
||||
if (user_agent && strcasestr(user_agent, "remote"))
|
||||
return 1;
|
||||
|
||||
if (!file_codectype)
|
||||
{
|
||||
DPRINTF(E_LOG, L_XCODE, "Can't proceed, codectype is unknown (null)\n");
|
||||
@@ -763,10 +765,8 @@ transcode_needed(struct evkeyvalq *headers, char *file_codectype)
|
||||
}
|
||||
}
|
||||
|
||||
client_codecs = evhttp_find_header(headers, "Accept-Codecs");
|
||||
if (!client_codecs)
|
||||
{
|
||||
user_agent = evhttp_find_header(headers, "User-Agent");
|
||||
if (user_agent)
|
||||
{
|
||||
DPRINTF(E_DBG, L_XCODE, "User-Agent: %s\n", user_agent);
|
||||
@@ -787,12 +787,6 @@ transcode_needed(struct evkeyvalq *headers, char *file_codectype)
|
||||
{
|
||||
DPRINTF(E_DBG, L_XCODE, "Client is Front Row, using iTunes codecs\n");
|
||||
|
||||
client_codecs = itunes_codecs;
|
||||
}
|
||||
else if (strncmp(user_agent, "Remote", strlen("Remote")) == 0)
|
||||
{
|
||||
DPRINTF(E_DBG, L_XCODE, "Client is Remote, using iTunes codecs\n");
|
||||
|
||||
client_codecs = itunes_codecs;
|
||||
}
|
||||
else if (strncmp(user_agent, "AppleCoreMedia", strlen("AppleCoreMedia")) == 0)
|
||||
|
||||
Reference in New Issue
Block a user