Added -N option to not start input if not already running
This commit is contained in:
parent
40a06701bf
commit
2e9eb51baf
1 changed files with 20 additions and 4 deletions
|
@ -29,6 +29,13 @@ namespace Mist{
|
||||||
capa["optional"]["debug"]["help"] = "The debug level at which messages need to be printed.";
|
capa["optional"]["debug"]["help"] = "The debug level at which messages need to be printed.";
|
||||||
capa["optional"]["debug"]["option"] = "--debug";
|
capa["optional"]["debug"]["option"] = "--debug";
|
||||||
capa["optional"]["debug"]["type"] = "debug";
|
capa["optional"]["debug"]["type"] = "debug";
|
||||||
|
|
||||||
|
JSON::Value option;
|
||||||
|
option["long"] = "noinput";
|
||||||
|
option["short"] = "N";
|
||||||
|
option["help"] = "Do not start input if not already started";
|
||||||
|
option["value"].append(0ll);
|
||||||
|
cfg->addOption("noinput", option);
|
||||||
}
|
}
|
||||||
|
|
||||||
Output::Output(Socket::Connection & conn) : myConn(conn){
|
Output::Output(Socket::Connection & conn) : myConn(conn){
|
||||||
|
@ -160,10 +167,19 @@ namespace Mist{
|
||||||
/// Finally, calls updateMeta()
|
/// Finally, calls updateMeta()
|
||||||
void Output::reconnect(){
|
void Output::reconnect(){
|
||||||
thisPacket.null();
|
thisPacket.null();
|
||||||
if (!Util::startInput(streamName)){
|
if (config->hasOption("noinput") && config->getBool("noinput")){
|
||||||
FAIL_MSG("Opening stream %s failed - aborting initialization", streamName.c_str());
|
Util::sanitizeName(streamName);
|
||||||
onFail();
|
if (!Util::streamAlive(streamName)){
|
||||||
return;
|
FAIL_MSG("Stream %s not already active - aborting initialization", streamName.c_str());
|
||||||
|
onFail();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (!Util::startInput(streamName)){
|
||||||
|
FAIL_MSG("Opening stream %s failed - aborting initialization", streamName.c_str());
|
||||||
|
onFail();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (statsPage.getData()){
|
if (statsPage.getData()){
|
||||||
statsPage.finish();
|
statsPage.finish();
|
||||||
|
|
Loading…
Add table
Reference in a new issue