MistIn processes now automatically add .dtsc to the end of output file, if missing.

This commit is contained in:
Thulinma 2014-05-01 13:44:36 +02:00
parent eaa26e05ef
commit 8f02ac216f

View file

@ -86,11 +86,15 @@ namespace Mist {
if (!config->getBool("player")){
//check filename for no -
if (config->getString("output") != "-"){
std::string filename = config->getString("output");
if (filename.size() < 5 || filename.substr(filename.size() - 5) != ".dtsc"){
filename += ".dtsc";
}
//output to dtsc
DTSC::Meta newMeta = myMeta;
newMeta.reset();
JSON::Value tempVal;
std::ofstream file(config->getString("output").c_str());
std::ofstream file(filename.c_str());
long long int bpos = 0;
seek(0);
getNext();
@ -105,7 +109,7 @@ namespace Mist {
//close file
file.close();
//create header
file.open((config->getString("output")+".dtsh").c_str());
file.open((filename+".dtsh").c_str());
file << newMeta.toJSON().toNetPacked();
file.close();
}else{