Speeding up DTSC Reading without header
This commit is contained in:
parent
149fe75b1c
commit
d6b503b267
2 changed files with 4 additions and 18 deletions
|
@ -39,17 +39,9 @@ namespace Analysers {
|
|||
long long unsigned int bfrm_max = 0;
|
||||
long long unsigned int bps = 0;
|
||||
|
||||
std::set<int> selector;
|
||||
for (JSON::ObjIter trackIt = meta["tracks"].ObjBegin(); trackIt != meta["tracks"].ObjEnd(); trackIt++){
|
||||
selector.insert(trackIt->second["trackid"].asInt());
|
||||
}
|
||||
F.selectTracks(selector);
|
||||
|
||||
F.getMeta().null();
|
||||
|
||||
F.seek_time(0);
|
||||
|
||||
F.seekNext();
|
||||
F.parseNext();
|
||||
while (F.getJSON()){
|
||||
nowpack = F.getJSON()["time"].asInt();
|
||||
std::cout << F.getJSON().toPrettyString() << std::endl;
|
||||
|
@ -104,7 +96,7 @@ namespace Analysers {
|
|||
totalvideo += F.getJSON()["data"].asString().size();
|
||||
lastvideo = nowpack;
|
||||
}
|
||||
F.seekNext();
|
||||
F.parseNext();
|
||||
}
|
||||
|
||||
std::cout << std::endl << "Summary:" << std::endl;
|
||||
|
|
|
@ -62,10 +62,7 @@ namespace Converters {
|
|||
std::string currentID;
|
||||
int nextFreeID = 0;
|
||||
|
||||
std::set<int> tmp;
|
||||
|
||||
for (JSON::ObjIter it = meta["tracks"].ObjBegin(); it != meta["tracks"].ObjEnd(); it++){
|
||||
tmp.insert(it->second["trackid"].asInt());
|
||||
trackIDs.insert(std::pair<std::string,int>(it->first,it->second["trackid"].asInt()));
|
||||
trackData[it->first].type = it->second["type"].asString();
|
||||
trackData[it->first].trackID = it->second["trackid"].asInt();
|
||||
|
@ -83,10 +80,7 @@ namespace Converters {
|
|||
it->second.removeMember("keys");
|
||||
}
|
||||
|
||||
F.selectTracks(tmp);
|
||||
F.seek_time(0);
|
||||
|
||||
F.seekNext();
|
||||
F.parseNext();
|
||||
while ( !F.getJSON().isNull()){
|
||||
currentID = "";
|
||||
if (F.getJSON()["trackid"].asInt() == 0){
|
||||
|
@ -113,7 +107,7 @@ namespace Converters {
|
|||
trackData[currentID].type = F.getJSON()["datatype"].asString();
|
||||
}else{
|
||||
fprintf(stderr, "Found an unknown package with packetid 0 and datatype %s\n",F.getJSON()["datatype"].asString().c_str());
|
||||
F.seekNext();
|
||||
F.parseNext();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue