X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECProcessor.cpp;h=d9981b9368d37e8d53c86510bca6fb5a1337eaf4;hb=4691dc3b885e390988f6104336afc682f3b157a2;hp=0714d2a659b7f31c025d3ff15e6730465fdb10fb;hpb=60c28d825a9439721d83129781a480ecef4f0577;p=deb_libcec.git diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 0714d2a..d9981b9 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -81,9 +81,7 @@ bool CCECProcessor::Start(const char *strPort, uint16_t iBaudRate /* = CEC_SERIA // create the processor thread if (!IsRunning()) { - if (CreateThread()) - m_libcec->AddLog(CEC_LOG_DEBUG, "processor thread started"); - else + if (!CreateThread()) { m_libcec->AddLog(CEC_LOG_ERROR, "could not create a processor thread"); return false; @@ -645,7 +643,7 @@ CCECTuner *CCECProcessor::GetTuner(cec_logical_address address) const bool CCECProcessor::RegisterClient(CCECClient *client) { - if (!client) + if (!client || !IsRunning()) return false; // unregister the client first if it's already been marked as registered @@ -732,7 +730,8 @@ void CCECProcessor::UnregisterClient(CCECClient *client) if (!client) return; - m_libcec->AddLog(CEC_LOG_NOTICE, "unregistering client: %s", client->GetConnectionInfo().c_str()); + if (client->IsRegistered()) + m_libcec->AddLog(CEC_LOG_NOTICE, "unregistering client: %s", client->GetConnectionInfo().c_str()); // notify the client that it will be unregistered client->OnUnregister();