From a3ae7c365f506afe00a40fe62c57d9e3112b817a Mon Sep 17 00:00:00 2001 From: ozzay Date: Mon, 22 Dec 2014 11:50:12 +0100 Subject: [PATCH] Semaphore will not appear when in converter mode --- src/input/mist_in.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/input/mist_in.cpp b/src/input/mist_in.cpp index 79f0d7b5..1f04fa15 100644 --- a/src/input/mist_in.cpp +++ b/src/input/mist_in.cpp @@ -14,10 +14,13 @@ int main(int argc, char * argv[]) { Util::Config conf(argv[0], PACKAGE_VERSION); mistIn conv(&conf); if (conf.parseArgs(argc, argv)) { - IPC::semaphore playerLock(std::string("/lock_" + conf.getString("streamname")).c_str(), O_CREAT | O_RDWR, ACCESSPERMS, 1); - if (!playerLock.tryWait()){ - DEBUG_MSG(DLVL_DEVEL, "A player for stream %s is already running", conf.getString("streamname").c_str()); - return 1; + IPC::semaphore playerLock; + if(conf.getString("streamname").size()){ + playerLock.open(std::string("/lock_" + conf.getString("streamname")).c_str(), O_CREAT | O_RDWR, ACCESSPERMS, 1); + if (!playerLock.tryWait()){ + DEBUG_MSG(DLVL_DEVEL, "A player for stream %s is already running", conf.getString("streamname").c_str()); + return 1; + } } conf.activate(); while (conf.is_active){