repositories
/
deb_libcec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
60c28d8
)
cec: don't allow client registrations when the processor thread isn't running
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Mon, 14 May 2012 08:47:10 +0000
(10:47 +0200)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Mon, 14 May 2012 08:47:10 +0000
(10:47 +0200)
src/lib/CECProcessor.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/lib/CECProcessor.cpp
b/src/lib/CECProcessor.cpp
index 0714d2a659b7f31c025d3ff15e6730465fdb10fb..d9981b9368d37e8d53c86510bca6fb5a1337eaf4 100644
(file)
--- 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())
{
// 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;
{
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)
{
bool CCECProcessor::RegisterClient(CCECClient *client)
{
- if (!client)
+ if (!client
|| !IsRunning()
)
return false;
// unregister the client first if it's already been marked as registered
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;
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();
// notify the client that it will be unregistered
client->OnUnregister();