Optimized file output from all MistIn* processes.

This commit is contained in:
Thulinma 2014-12-13 00:14:51 +01:00
parent a9bf4fea4a
commit 3030be0384

View file

@ -123,16 +123,13 @@ namespace Mist {
//output to dtsc
DTSC::Meta newMeta = myMeta;
newMeta.reset();
JSON::Value tempVal;
std::ofstream file(filename.c_str());
long long int bpos = 0;
seek(0);
getNext();
while (lastPack){
tempVal = lastPack.toJSON();
tempVal["bpos"] = bpos;
newMeta.update(tempVal);
file << std::string(lastPack.getData(), lastPack.getDataLen());
newMeta.updatePosOverride(lastPack, bpos);
file.write(lastPack.getData(), lastPack.getDataLen());
bpos += lastPack.getDataLen();
getNext();
}