[httpd] Check speaker settings to determine DAAP/RSP stream format

This commit is contained in:
ejurgensen
2024-01-10 21:20:31 +01:00
parent 62b42ce354
commit ff2d0b4ab1
9 changed files with 92 additions and 12 deletions

View File

@@ -415,7 +415,7 @@ rsp_reply_db(struct httpd_request *hreq)
}
static int
item_add(xml_node *parent, struct query_params *qp, const char *user_agent, const char *client_codecs, int mode)
item_add(xml_node *parent, struct query_params *qp, const char *user_agent, const char *address, const char *accept_codecs, int mode)
{
struct media_quality quality = { 0 };
struct db_media_file_info dbmfi;
@@ -432,7 +432,7 @@ item_add(xml_node *parent, struct query_params *qp, const char *user_agent, cons
if (ret != 0)
return ret;
profile = transcode_needed(user_agent, client_codecs, dbmfi.codectype);
profile = httpd_xcode_profile_get(user_agent, address, accept_codecs, dbmfi.codectype);
if (profile == XCODE_UNKNOWN)
{
DPRINTF(E_LOG, L_DAAP, "Cannot transcode '%s', codec type is unknown\n", dbmfi.fname);
@@ -484,7 +484,7 @@ rsp_reply_playlist(struct httpd_request *hreq)
{
struct query_params qp;
const char *param;
const char *client_codecs;
const char *accept_codecs;
xml_node *response;
xml_node *items;
int mode;
@@ -493,7 +493,7 @@ rsp_reply_playlist(struct httpd_request *hreq)
memset(&qp, 0, sizeof(struct query_params));
client_codecs = httpd_header_find(hreq->in_headers, "Accept-Codecs");
accept_codecs = httpd_header_find(hreq->in_headers, "Accept-Codecs");
ret = safe_atoi32(hreq->path_parts[2], &qp.id);
if (ret < 0)
@@ -555,7 +555,7 @@ rsp_reply_playlist(struct httpd_request *hreq)
items = xml_new_node(response, "items", NULL);
do
{
ret = item_add(items, &qp, hreq->user_agent, client_codecs, mode);
ret = item_add(items, &qp, hreq->user_agent, hreq->peer_address, accept_codecs, mode);
}
while (ret == 0);