// 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;
bool CCECProcessor::RegisterClient(CCECClient *client)
{
- if (!client)
+ if (!client || !IsRunning())
return false;
// unregister the client first if it's already been marked as registered
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();