$basename and $wildcard support in stream push commands

This commit is contained in:
Thulinma 2017-06-22 10:34:34 +02:00
parent 0e1a18986a
commit 9bdc6fd7c3

View file

@ -350,6 +350,15 @@ pid_t Util::startPush(const std::string & streamname, std::string & target) {
// The target can hold variables like current time etc // The target can hold variables like current time etc
replace_variables(target); replace_variables(target);
replace(target, "$stream", streamname); replace(target, "$stream", streamname);
if (streamname.find('+') != std::string::npos){
std::string strbase = streamname.substr(0, streamname.find('+'));
std::string strext = streamname.substr(streamname.find('+')+1);
replace(target, "$basename", strbase);
replace(target, "$wildcard", strext);
}else{
replace(target, "$basename", streamname);
replace(target, "$wildcard", "");
}
//Attempt to load up configuration and find this stream //Attempt to load up configuration and find this stream
IPC::sharedPage mistConfOut(SHM_CONF, DEFAULT_CONF_PAGE_SIZE); IPC::sharedPage mistConfOut(SHM_CONF, DEFAULT_CONF_PAGE_SIZE);