Added mono/stereo/surround/Xch track selectors for audio tracks
This commit is contained in:
parent
28060d2113
commit
a11a6f1b4a
1 changed files with 29 additions and 0 deletions
|
@ -821,6 +821,35 @@ std::set<size_t> Util::findTracks(const DTSC::Meta &M, const JSON::Value &capa,
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//audio channel matching
|
||||||
|
if (!trackType.size() || trackType == "audio"){
|
||||||
|
if (trackLow == "surround"){
|
||||||
|
std::set<size_t> validTracks = getSupportedTracks(M, capa);
|
||||||
|
for (std::set<size_t>::iterator it = validTracks.begin(); it != validTracks.end(); it++){
|
||||||
|
const DTSC::Track & Trk = M.tracks.at(*it);
|
||||||
|
if (!trackType.size() || Trk.type == trackType || Trk.codec == trackType){
|
||||||
|
if (Trk.channels > 2){result.insert(*it);}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
unsigned int channelVal;
|
||||||
|
uint32_t targetChannel = 0;
|
||||||
|
if (trackLow == "mono"){targetChannel = 1;}
|
||||||
|
if (trackLow == "stereo"){targetChannel = 2;}
|
||||||
|
if (trackLow == "stereo"){targetChannel = 2;}
|
||||||
|
if (trackLow.find("ch") != std::string::npos && sscanf(trackLow.c_str(), "%uch", &channelVal) == 1){targetChannel = channelVal;}
|
||||||
|
if (targetChannel){
|
||||||
|
std::set<size_t> validTracks = getSupportedTracks(M, capa);
|
||||||
|
for (std::set<size_t>::iterator it = validTracks.begin(); it != validTracks.end(); it++){
|
||||||
|
const DTSC::Track & Trk = M.tracks.at(*it);
|
||||||
|
if (!trackType.size() || Trk.type == trackType || Trk.codec == trackType){
|
||||||
|
if (Trk.channels == targetChannel){result.insert(*it);}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
//approx resolution matching
|
//approx resolution matching
|
||||||
if (!trackType.size() || trackType == "video"){
|
if (!trackType.size() || trackType == "video"){
|
||||||
if (trackLow == "highres" || trackLow == "bestres" || trackLow == "maxres"){
|
if (trackLow == "highres" || trackLow == "bestres" || trackLow == "maxres"){
|
||||||
|
|
Loading…
Add table
Reference in a new issue