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:
3af4914
)
cec: wait until the commandhandler is replaced before registering a client, so we...
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Thu, 2 Aug 2012 15:47:09 +0000
(17:47 +0200)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Thu, 2 Aug 2012 15:47:09 +0000
(17:47 +0200)
src/lib/CECProcessor.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/lib/CECProcessor.cpp
b/src/lib/CECProcessor.cpp
index db6f8a16876bd1c8a2c2330be4dc78280c00b5c0..6461ca9b2bd1da66f2e134f3d465ed868aa609af 100644
(file)
--- a/
src/lib/CECProcessor.cpp
+++ b/
src/lib/CECProcessor.cpp
@@
-670,8
+670,14
@@
bool CCECProcessor::RegisterClient(CCECClient *client)
tvVendor = tv->GetVendorId(CECDEVICE_UNREGISTERED);
else if (m_communication->SupportsSourceLogicalAddress(CECDEVICE_FREEUSE))
tvVendor = tv->GetVendorId(CECDEVICE_FREEUSE);
tvVendor = tv->GetVendorId(CECDEVICE_UNREGISTERED);
else if (m_communication->SupportsSourceLogicalAddress(CECDEVICE_FREEUSE))
tvVendor = tv->GetVendorId(CECDEVICE_FREEUSE);
- if (tvVendor != CEC_VENDOR_UNKNOWN)
- tv->ReplaceHandler(false);
+
+ // wait until the handler is replaced, to avoid double registrations
+ if (tvVendor != CEC_VENDOR_UNKNOWN &&
+ CCECCommandHandler::HasSpecificHandler(tvVendor))
+ {
+ while (!tv->ReplaceHandler(false))
+ CEvent::Sleep(5);
+ }
// get the configuration from the client
m_libcec->AddLog(CEC_LOG_NOTICE, "registering new CEC client - v%s", ToString((cec_client_version)configuration.clientVersion));
// get the configuration from the client
m_libcec->AddLog(CEC_LOG_NOTICE, "registering new CEC client - v%s", ToString((cec_client_version)configuration.clientVersion));