mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-10 14:09:51 -05:00
add general/never_transcode to specify codectypes that shouldn't be transcoded, even if the client suggests it can't play it (amarok, rhythmbox, others that lie about user-agent)
This commit is contained in:
@@ -123,6 +123,7 @@ static CONF_ELEMENTS conf_elements[] = {
|
||||
{ 0, 0, CONF_T_STRING,"general","ssc_codectypes" },
|
||||
{ 0, 0, CONF_T_STRING,"general","ssc_prog" },
|
||||
{ 0, 0, CONF_T_STRING,"general","password" },
|
||||
{ 0, 0, CONF_T_STRING,"general","never_transcode" },
|
||||
{ 0, 0, CONF_T_MULTICOMMA,"general","compdirs" },
|
||||
{ 0, 0, CONF_T_STRING,"general","logfile" },
|
||||
{ 0, 0, CONF_T_EXISTPATH,"plugins","plugin_dir" },
|
||||
|
||||
13
src/plugin.c
13
src/plugin.c
@@ -446,12 +446,23 @@ int plugin_ssc_should_transcode(WS_CONNINFO *pwsc, char *codec) {
|
||||
int result;
|
||||
char *native_codecs=NULL;
|
||||
char *user_agent=NULL;
|
||||
|
||||
char *never_transcode = NULL;
|
||||
|
||||
if(!codec) {
|
||||
DPRINTF(E_LOG,L_PLUG,"testing transcode on null codec?\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
never_transcode = conf_alloc_string("general","never_transcode",NULL);
|
||||
if(never_transcode) {
|
||||
if(strstr(never_transcode,codec)) {
|
||||
free(never_transcode);
|
||||
return FALSE;
|
||||
}
|
||||
free(never_transcode);
|
||||
}
|
||||
|
||||
if(pwsc) {
|
||||
/* see if the headers give us any guidance */
|
||||
native_codecs = ws_getrequestheader(pwsc,"accept-codecs");
|
||||
|
||||
Reference in New Issue
Block a user