mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-24 03:27:46 -05:00
Implement is_remote() and change how transcode_needed() is used
transcode_needed() was getting called needlessly in http_daapd.c, because 1) once it is determined that a given codec needs transcoding for a given client there is no reason to call and check again, 2) transcoding is irrelevant for remotes. Also some cleaning up of user_agent_filter().
This commit is contained in:
@@ -767,7 +767,6 @@ transcode_cleanup(struct transcode_ctx *ctx)
|
||||
free(ctx);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
transcode_needed(const char *user_agent, const char *client_codecs, char *file_codectype)
|
||||
{
|
||||
@@ -776,15 +775,9 @@ transcode_needed(const char *user_agent, const char *client_codecs, char *file_c
|
||||
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;
|
||||
else if (user_agent && strcasestr(user_agent, "android"))
|
||||
return 1;
|
||||
|
||||
if (!file_codectype)
|
||||
{
|
||||
DPRINTF(E_LOG, L_XCODE, "Can't proceed, codectype is unknown (null)\n");
|
||||
DPRINTF(E_LOG, L_XCODE, "Can't determine transcode status, codec type is unknown\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user