diff --git a/lib/stream.h b/lib/stream.h index 021d94f3..8f75abdd 100644 --- a/lib/stream.h +++ b/lib/stream.h @@ -11,8 +11,6 @@ namespace Util { void sanitizeName(std::string & streamname); bool streamAlive(std::string & streamname); bool startInput(std::string streamname, std::string filename = "", bool forkFirst = true); - /* roxlu-begin */ int startRecording(std::string streamname); - /* roxlu-end */ JSON::Value getStreamConfig(std::string streamname); } diff --git a/src/output/output.cpp b/src/output/output.cpp index ac81a026..88a23693 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -278,16 +278,6 @@ namespace Mist { onFail(); return; } - if (!source.size()){ - std::string strName = streamName; - Util::sanitizeName(strName); - IPC::sharedPage serverCfg("!mistConfig", DEFAULT_CONF_PAGE_SIZE, false, false); ///< Contains server configuration and capabilities - IPC::semaphore configLock("!mistConfLock", O_CREAT | O_RDWR, ACCESSPERMS, 1); - configLock.wait(); - DTSC::Scan streamCfg = DTSC::Scan(serverCfg.mapped, serverCfg.len).getMember("streams").getMember(strName); - source = streamCfg.getMember("source").asString(); - configLock.post(); - } char pageId[NAME_BUFFER_SIZE]; snprintf(pageId, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str()); nProxy.metaPages.clear(); @@ -430,6 +420,20 @@ namespace Mist { for (std::map::iterator trit = myMeta.tracks.begin(); trit != myMeta.tracks.end(); trit++){ INSANE_MSG("Found track/codec: %s", trit->second.codec.c_str()); } + static std::string source; + if (!source.size()){ + IPC::sharedPage serverCfg(SHM_CONF, DEFAULT_CONF_PAGE_SIZE, false, false); ///< Contains server configuration and capabilities + IPC::semaphore configLock(SEM_CONF, O_CREAT | O_RDWR, ACCESSPERMS, 1); + configLock.wait(); + std::string smp = streamName.substr(0, streamName.find_first_of("+ ")); + //check if smp (everything before + or space) exists + DTSC::Scan streamCfg = DTSC::Scan(serverCfg.mapped, serverCfg.len).getMember("streams").getMember(smp); + if (streamCfg){ + source = streamCfg.getMember("source").asString(); + } + configLock.post(); + configLock.close(); + } if (!myMeta.tracks.size() && (source.find("dtsc://") == 0)){ //Wait 5 seconds and try again. Keep a counter, try at most 3 times static int counter = 0; diff --git a/src/output/output.h b/src/output/output.h index f9443091..31af830b 100644 --- a/src/output/output.h +++ b/src/output/output.h @@ -108,8 +108,6 @@ namespace Mist { bool sought;///