Revert "[daap] Fix for Apple Music/iTunes not working on Airplay host"

This reverts commit 73864e82cd267da65b7245430bd1a2060d8bec81.
This commit is contained in:
ejurgensen 2024-09-30 16:13:31 +02:00
parent 73864e82cd
commit b9fa790f50

View File

@ -1149,6 +1149,7 @@ daap_reply_songlist_generic(struct httpd_request *hreq, int playlist)
const char *accept_codecs; const char *accept_codecs;
const char *tag; const char *tag;
size_t len; size_t len;
enum transcode_profile spk_profile;
enum transcode_profile profile; enum transcode_profile profile;
struct transcode_metadata_string xcode_metadata; struct transcode_metadata_string xcode_metadata;
struct media_quality quality = { 0 }; struct media_quality quality = { 0 };
@ -1222,6 +1223,10 @@ daap_reply_songlist_generic(struct httpd_request *hreq, int playlist)
accept_codecs = httpd_header_find(hreq->in_headers, "Accept-Codecs"); accept_codecs = httpd_header_find(hreq->in_headers, "Accept-Codecs");
} }
spk_profile = httpd_xcode_profile_get(hreq);
DPRINTF(E_DBG, L_DAAP, "Speaker check of '%s' (codecs '%s') returned %d\n", hreq->user_agent, accept_codecs, spk_profile);
nsongs = 0; nsongs = 0;
while ((ret = db_query_fetch_file(&dbmfi, &qp)) == 0) while ((ret = db_query_fetch_file(&dbmfi, &qp)) == 0)
{ {
@ -1236,6 +1241,9 @@ daap_reply_songlist_generic(struct httpd_request *hreq, int playlist)
} }
else if (profile != XCODE_NONE) else if (profile != XCODE_NONE)
{ {
if (spk_profile != XCODE_NONE)
profile = spk_profile;
if (safe_atou32(dbmfi.song_length, &len_ms) < 0) if (safe_atou32(dbmfi.song_length, &len_ms) < 0)
len_ms = 3 * 60 * 1000; // just a fallback default len_ms = 3 * 60 * 1000; // just a fallback default