Fix crash on no user-agent, fixing ticket #164

This commit is contained in:
Ron Pedde 2006-06-19 05:47:38 +00:00
parent c926c05c6e
commit 5859bca5ac

View File

@ -588,10 +588,12 @@ int plugin_ssc_should_transcode(WS_CONNINFO *pwsc, char *codec) {
native_codecs = ws_getrequestheader(pwsc,"accept-codecs");
if(!native_codecs) {
user_agent = ws_getrequestheader(pwsc,"user-agent");
if(strncmp(user_agent,"iTunes",6)==0) {
native_codecs = "mpeg,mp4a,wav,mp4v,alac";
} else if(strncmp(user_agent,"Roku",4)==0) {
native_codecs = "mpeg,mp4a,wav,wma";
if(user_agent) {
if(strncmp(user_agent,"iTunes",6)==0) {
native_codecs = "mpeg,mp4a,wav,mp4v,alac";
} else if(strncmp(user_agent,"Roku",4)==0) {
native_codecs = "mpeg,mp4a,wav,wma";
}
}
}
}