HLS/DASH stream track selector support in index URLs, fixed source matching when multi-select or type-select is used, handle user agent exceptions in Output::selectDefaultTracks(), added Util::codecString to stream.h library, removed duplicate/wrong code from DASH/HLS outputs

This commit is contained in:
Thulinma 2019-04-24 14:22:07 +02:00
parent bd34bafc03
commit b8415d09c6
8 changed files with 237 additions and 162 deletions

View file

@ -541,6 +541,17 @@ namespace Mist{
if (strRef[shift] == '+'){multiSel = true; ++shift;}
for (std::set<unsigned long>::iterator itd = selectedTracks.begin(); itd != selectedTracks.end(); itd++){
if ((!byType && myMeta.tracks[*itd].codec == strRef.substr(shift)) || (byType && myMeta.tracks[*itd].type == strRef.substr(shift)) || strRef.substr(shift) == "*"){
//user-agent-check
bool problems = false;
if (capa.isMember("exceptions") && capa["exceptions"].isObject() && capa["exceptions"].size()){
jsonForEach(capa["exceptions"], ex){
if (ex.key() == "codec:"+strRef.substr(shift)){
problems = !Util::checkException(*ex, UA);
break;
}
}
}
if (problems){break;}
selCounter++;
if (!multiSel){
break;
@ -600,6 +611,17 @@ namespace Mist{
if (noSelAudio && trit->second.type == "audio"){continue;}
if (noSelVideo && trit->second.type == "video"){continue;}
if (noSelSub && (trit->second.type == "subtitle" || trit->second.codec == "subtitle")){continue;}
//user-agent-check
bool problems = false;
if (capa.isMember("exceptions") && capa["exceptions"].isObject() && capa["exceptions"].size()){
jsonForEach(capa["exceptions"], ex){
if (ex.key() == "codec:"+strRef.substr(shift)){
problems = !Util::checkException(*ex, UA);
break;
}
}
}
if (problems){continue;}
/*LTS-END*/
selectedTracks.insert(trit->first);
found = true;
@ -614,6 +636,17 @@ namespace Mist{
if (noSelAudio && trit->second.type == "audio"){continue;}
if (noSelVideo && trit->second.type == "video"){continue;}
if (noSelSub && (trit->second.type == "subtitle" || trit->second.codec == "subtitle")){continue;}
//user-agent-check
bool problems = false;
if (capa.isMember("exceptions") && capa["exceptions"].isObject() && capa["exceptions"].size()){
jsonForEach(capa["exceptions"], ex){
if (ex.key() == "codec:"+strRef.substr(shift)){
problems = !Util::checkException(*ex, UA);
break;
}
}
}
if (problems){continue;}
/*LTS-END*/
selectedTracks.insert(trit->first);
found = true;