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:
Ron Pedde
2006-10-31 03:54:10 +00:00
parent 40c33218f3
commit 137875c23d
3 changed files with 20 additions and 1 deletions

View File

@@ -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" },

View File

@@ -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");