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:
ejurgensen
2014-12-28 23:37:12 +01:00
parent 3e412b5e65
commit a69619a5a7
2 changed files with 55 additions and 27 deletions

View File

@@ -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;
}