From fc5adc6ac0b9457303a2c057fc0900631f472c72 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Wed, 19 Jul 2017 11:28:20 +0200 Subject: [PATCH] LTS commit of OS edition Input edits --- src/input/input_av.cpp | 9 ++++++--- src/input/input_av.h | 3 ++- src/input/input_balancer.h | 2 +- src/input/input_buffer.cpp | 2 +- src/input/input_dtsccrypt.cpp | 2 +- src/input/input_dtsccrypt.h | 2 +- src/input/input_folder.h | 2 +- src/input/input_hls.cpp | 2 +- src/input/input_hls.h | 2 +- src/input/input_ismv.cpp | 5 ++++- src/input/input_ismv.h | 3 ++- src/input/input_mp4.cpp | 5 ++++- src/input/input_mp4.h | 3 ++- src/input/input_ts.cpp | 2 +- src/input/input_ts.h | 3 ++- 15 files changed, 30 insertions(+), 17 deletions(-) diff --git a/src/input/input_av.cpp b/src/input/input_av.cpp index d4dff996..8c73b4d3 100644 --- a/src/input/input_av.cpp +++ b/src/input/input_av.cpp @@ -41,7 +41,7 @@ namespace Mist { } } - bool inputAV::setup() { + bool inputAV::checkArguments() { if (config->getString("input") == "-") { std::cerr << "Input from stdin not yet supported" << std::endl; return false; @@ -57,9 +57,12 @@ namespace Mist { return false; } } + return true; + } + bool inputAV::preRun(){ //make sure all av inputs are registered properly, just in case - //setup() already does this, but under windows it doesn't remember that it has. + //the constructor already does this, but under windows it doesn't remember that it has. //Very sad, that. We may need to get windows some medication for it. av_register_all(); @@ -204,7 +207,7 @@ namespace Mist { return;//success! } thisPacket.null(); - setup(); + preRun(); //failure :-( DEBUG_MSG(DLVL_FAIL, "getNext failed"); } diff --git a/src/input/input_av.h b/src/input/input_av.h index 9cc2892e..4f5837aa 100644 --- a/src/input/input_av.h +++ b/src/input/input_av.h @@ -19,7 +19,8 @@ namespace Mist { ~inputAV(); protected: //Private Functions - bool setup(); + bool checkArguments(); + bool preRun(); bool readHeader(); void getNext(bool smart = true); void seek(int seekTime); diff --git a/src/input/input_balancer.h b/src/input/input_balancer.h index a048b6e1..2ad5c668 100644 --- a/src/input/input_balancer.h +++ b/src/input/input_balancer.h @@ -7,7 +7,7 @@ namespace Mist { inputBalancer(Util::Config * cfg); int boot(int argc, char * argv[]); protected: - bool setup(){return false;}; + bool checkArguments(){return false;}; bool readHeader(){return false;}; }; } diff --git a/src/input/input_buffer.cpp b/src/input/input_buffer.cpp index d70720ad..f7ad0e28 100644 --- a/src/input/input_buffer.cpp +++ b/src/input/input_buffer.cpp @@ -596,7 +596,7 @@ namespace Mist { /*LTS-START*/ //Reload the configuration to make sure we stay up to date with changes through the api if (Util::epoch() - lastReTime > 4) { - setup(); + preRun(); } /*LTS-END*/ //Static variable keeping track of the next temporary mapping to use for a track. diff --git a/src/input/input_dtsccrypt.cpp b/src/input/input_dtsccrypt.cpp index 602e739e..3c8b31b0 100644 --- a/src/input/input_dtsccrypt.cpp +++ b/src/input/input_dtsccrypt.cpp @@ -52,7 +52,7 @@ namespace Mist { srand(time(NULL)); } - bool inputDTSC::setup() { + bool inputDTSC::checkArguments() { key = Encodings::Base64::decode(config->getString("key")); if (key == ""){ if (config->getString("keyseed") == "" || config->getString("keyid") == ""){ diff --git a/src/input/input_dtsccrypt.h b/src/input/input_dtsccrypt.h index 6e95c2e3..d6505ba7 100644 --- a/src/input/input_dtsccrypt.h +++ b/src/input/input_dtsccrypt.h @@ -7,7 +7,7 @@ namespace Mist { inputDTSC(Util::Config * cfg); protected: //Private Functions - bool setup(); + bool checkArguments(); bool readHeader(); void getNext(bool smart = true); void seek(int seekTime); diff --git a/src/input/input_folder.h b/src/input/input_folder.h index 71750b1d..bbd8b846 100644 --- a/src/input/input_folder.h +++ b/src/input/input_folder.h @@ -7,7 +7,7 @@ namespace Mist { inputFolder(Util::Config * cfg); int boot(int argc, char * argv[]); protected: - bool setup(){return false;}; + bool checkArguments(){return false;}; bool readHeader(){return false;}; }; } diff --git a/src/input/input_hls.cpp b/src/input/input_hls.cpp index b1fc1fe3..8a6fd001 100644 --- a/src/input/input_hls.cpp +++ b/src/input/input_hls.cpp @@ -286,7 +286,7 @@ namespace Mist{ if (inFile){fclose(inFile);} } - bool inputHLS::setup(){ + bool inputHLS::checkArguments(){ if (config->getString("input") == "-"){return false;} if (!initPlaylist(config->getString("input"))){return false;} diff --git a/src/input/input_hls.h b/src/input/input_hls.h index 762abe7a..52c875f9 100644 --- a/src/input/input_hls.h +++ b/src/input/input_hls.h @@ -101,7 +101,7 @@ namespace Mist{ int firstSegment(); void waitForNextSegment(); void readPMT(); - bool setup(); + bool checkArguments(); bool preSetup(); bool readHeader(); void getNext(bool smart = true); diff --git a/src/input/input_ismv.cpp b/src/input/input_ismv.cpp index 390aa5b5..e3045120 100644 --- a/src/input/input_ismv.cpp +++ b/src/input/input_ismv.cpp @@ -22,7 +22,7 @@ namespace Mist { inFile = 0; } - bool inputISMV::setup() { + bool inputISMV::checkArguments() { if (config->getString("input") == "-") { std::cerr << "Input from stdin not yet supported" << std::endl; return false; @@ -38,6 +38,9 @@ namespace Mist { return false; } } + return true; + } + bool inputISMV::preRun() { //open File inFile = fopen(config->getString("input").c_str(), "r"); if (!inFile) { diff --git a/src/input/input_ismv.h b/src/input/input_ismv.h index a7843d0d..3f70855f 100644 --- a/src/input/input_ismv.h +++ b/src/input/input_ismv.h @@ -29,7 +29,8 @@ namespace Mist { inputISMV(Util::Config * cfg); protected: //Private Functions - bool setup(); + bool checkArguments(); + bool preRun(); bool readHeader(); void getNext(bool smart = true); void seek(int seekTime); diff --git a/src/input/input_mp4.cpp b/src/input/input_mp4.cpp index 6472c789..5c986a62 100644 --- a/src/input/input_mp4.cpp +++ b/src/input/input_mp4.cpp @@ -156,7 +156,7 @@ namespace Mist { free(data); } - bool inputMP4::setup() { + bool inputMP4::checkArguments() { if (config->getString("input") == "-") { std::cerr << "Input from stdin not yet supported" << std::endl; return false; @@ -173,7 +173,10 @@ namespace Mist { } streamName = config->getString("streamname"); } + return true; + } + bool inputMP4::preRun() { //open File inFile = fopen(config->getString("input").c_str(), "r"); if (!inFile) { diff --git a/src/input/input_mp4.h b/src/input/input_mp4.h index 02e0aef6..43d2ab0e 100644 --- a/src/input/input_mp4.h +++ b/src/input/input_mp4.h @@ -84,7 +84,8 @@ namespace Mist { ~inputMP4(); protected: //Private Functions - bool setup(); + bool checkArguments(); + bool preRun(); bool readHeader(); void getNext(bool smart = true); void seek(int seekTime); diff --git a/src/input/input_ts.cpp b/src/input/input_ts.cpp index 665dbf5d..0a88658d 100755 --- a/src/input/input_ts.cpp +++ b/src/input/input_ts.cpp @@ -141,7 +141,7 @@ namespace Mist { } ///Live Setup of TS Input - bool inputTS::setup() { + bool inputTS::preRun() { const std::string & inpt = config->getString("input"); //streamed standard input if (inpt == "-") { diff --git a/src/input/input_ts.h b/src/input/input_ts.h index f0a4829a..a3b834cd 100755 --- a/src/input/input_ts.h +++ b/src/input/input_ts.h @@ -16,7 +16,8 @@ namespace Mist { bool needsLock(); protected: //Private Functions - bool setup(); + bool checkArguments(){return true;} + bool preRun(); bool readHeader(); void getNext(bool smart = true); void seek(int seekTime);