Merge branch 'development' into LTS_development

# Conflicts:
#	src/output/output_progressive_mp4.cpp
This commit is contained in:
Thulinma 2019-06-25 14:30:27 +02:00
commit 3c3489e7eb
2 changed files with 13 additions and 2 deletions

View file

@ -573,17 +573,27 @@ bool Util::checkException(const JSON::Value & ex, const std::string & useragent)
bool ret = true; bool ret = true;
jsonForEachConst(ex, e){ jsonForEachConst(ex, e){
if (!e->isArray() || !e->size()){continue;} if (!e->isArray() || !e->size()){continue;}
bool setTo = ((*e)[0u].asStringRef() == "whitelist"); bool setTo = false;
bool except = false;
//whitelist makes the return value true if any value is contained in the UA, blacklist makes it false.
//the '_except' variants do so only if none of the values are contained in the UA.
if ((*e)[0u].asStringRef() == "whitelist"){setTo = true; except = false;}
if ((*e)[0u].asStringRef() == "whitelist_except"){setTo = true; except = true;}
if ((*e)[0u].asStringRef() == "blacklist"){setTo = false; except = false;}
if ((*e)[0u].asStringRef() == "blacklist_except"){setTo = false; except = true;}
if (e->size() == 1){ if (e->size() == 1){
ret = setTo; ret = setTo;
continue; continue;
} }
if (!(*e)[1].isArray()){continue;} if (!(*e)[1].isArray()){continue;}
bool match = false;
jsonForEachConst((*e)[1u], i){ jsonForEachConst((*e)[1u], i){
if (useragent.find(i->asStringRef()) != std::string::npos){ if (useragent.find(i->asStringRef()) != std::string::npos){
ret = setTo; match = true;
} }
} }
//set the (temp) return value if this was either a match in regular mode, or a non-match in except-mode.
if (except != match){ret = setTo;}
} }
return ret; return ret;
} }

View file

@ -32,6 +32,7 @@ namespace Mist{
capa["methods"][0u]["priority"] = 10; capa["methods"][0u]["priority"] = 10;
//MP4 live is broken on Apple //MP4 live is broken on Apple
capa["exceptions"]["live"] = JSON::fromString("[[\"blacklist\",[\"iPad\",\"iPhone\",\"iPod\",\"Safari\"]], [\"whitelist\",[\"Chrome\",\"Chromium\"]]]"); capa["exceptions"]["live"] = JSON::fromString("[[\"blacklist\",[\"iPad\",\"iPhone\",\"iPod\",\"Safari\"]], [\"whitelist\",[\"Chrome\",\"Chromium\"]]]");
capa["exceptions"]["codec:MP3"] = JSON::fromString("[[\"blacklist\",[\"Windows NT 5\", \"Windows NT 6.0\", \"Windows NT 6.1\"]],[\"whitelist_except\",[\"Trident\"]]]");
} }
uint64_t OutProgressiveMP4::estimateFileSize(){ uint64_t OutProgressiveMP4::estimateFileSize(){