diff --git a/src/input/input.cpp b/src/input/input.cpp index 1fedae88..5adcc1cc 100644 --- a/src/input/input.cpp +++ b/src/input/input.cpp @@ -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{