mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-11 15:03:24 -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:
parent
40c33218f3
commit
137875c23d
@ -314,5 +314,12 @@
|
||||
<short_description></short_description>
|
||||
<type size="80">text</type>
|
||||
</item>
|
||||
<item id="general:never_transcode">
|
||||
<name>Never Transcode</name>
|
||||
<short_description>
|
||||
Codecs to not transcode, even if plugins are available
|
||||
</short_description>
|
||||
<type size="80">text</type>
|
||||
</item>
|
||||
</section>
|
||||
</config>
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user