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:
5d35534
)
cec: fix handler init
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Wed, 21 Dec 2011 23:55:45 +0000
(
00:55
+0100)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Wed, 21 Dec 2011 23:56:37 +0000
(
00:56
+0100)
src/lib/CECProcessor.cpp
patch
|
blob
|
blame
|
history
src/lib/implementations/CECCommandHandler.cpp
patch
|
blob
|
blame
|
history
src/lib/implementations/CECCommandHandler.h
patch
|
blob
|
blame
|
history
src/lib/implementations/SLCommandHandler.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/lib/CECProcessor.cpp
b/src/lib/CECProcessor.cpp
index 770b24bab6bfc937125b974f6acabd4204943092..5b1c06ea98b39e2da2da9f206a7803243452680d 100644
(file)
--- a/
src/lib/CECProcessor.cpp
+++ b/
src/lib/CECProcessor.cpp
@@
-170,9
+170,8
@@
bool CCECProcessor::Start(const char *strPort, uint16_t iBaudRate /* = 38400 */,
if (SetHDMIPort(m_iBaseDevice, m_iHDMIPort, true))
{
if (SetHDMIPort(m_iBaseDevice, m_iHDMIPort, true))
{
- /* init the default handler */
- if (m_busDevices[CECDEVICE_TV]->GetHandler()->GetVendorId() == CEC_VENDOR_UNKNOWN)
- m_busDevices[CECDEVICE_TV]->GetHandler()->InitHandler();
+ /* init the handler */
+ m_busDevices[CECDEVICE_TV]->GetHandler()->InitHandler();
m_controller->AddLog(CEC_LOG_DEBUG, "processor thread started");
return true;
m_controller->AddLog(CEC_LOG_DEBUG, "processor thread started");
return true;
diff --git
a/src/lib/implementations/CECCommandHandler.cpp
b/src/lib/implementations/CECCommandHandler.cpp
index 8d16a02fded9c611518c66207693ea95e29385d0..ef8a8f28f789c160839608641bfaa6b21ea3828b 100644
(file)
--- a/
src/lib/implementations/CECCommandHandler.cpp
+++ b/
src/lib/implementations/CECCommandHandler.cpp
@@
-44,7
+44,8
@@
CCECCommandHandler::CCECCommandHandler(CCECBusDevice *busDevice) :
m_processor(m_busDevice->GetProcessor()),
m_iTransmitTimeout(CEC_DEFAULT_TRANSMIT_TIMEOUT),
m_iTransmitWait(CEC_DEFAULT_TRANSMIT_WAIT),
m_processor(m_busDevice->GetProcessor()),
m_iTransmitTimeout(CEC_DEFAULT_TRANSMIT_TIMEOUT),
m_iTransmitWait(CEC_DEFAULT_TRANSMIT_WAIT),
- m_iTransmitRetries(CEC_DEFAULT_TRANSMIT_RETRIES)
+ m_iTransmitRetries(CEC_DEFAULT_TRANSMIT_RETRIES),
+ m_bHandlerInited(false)
{
}
{
}
@@
-946,8
+947,12
@@
bool CCECCommandHandler::InitHandler(void)
primary->SetPowerStatus(CEC_POWER_STATUS_ON);
primary->SetMenuState(CEC_MENU_STATE_ACTIVATED);
primary->SetPowerStatus(CEC_POWER_STATUS_ON);
primary->SetMenuState(CEC_MENU_STATE_ACTIVATED);
- m_processor->SetActiveSource();
- primary->TransmitMenuState(m_busDevice->GetLogicalAddress());
+ if (m_processor->GetPrimaryDevice()->GetPhysicalAddress(false) != 0xffff)
+ {
+ m_processor->SetActiveSource();
+ primary->TransmitMenuState(m_busDevice->GetLogicalAddress());
+ m_bHandlerInited = true;
+ }
}
return true;
}
}
return true;
}
diff --git
a/src/lib/implementations/CECCommandHandler.h
b/src/lib/implementations/CECCommandHandler.h
index 762052bc6050c752e56fd0a7d16650f0a492fb55..0469b31e0eaf6412360f6ced970c8f4cad619a4e 100644
(file)
--- a/
src/lib/implementations/CECCommandHandler.h
+++ b/
src/lib/implementations/CECCommandHandler.h
@@
-130,6
+130,7
@@
namespace CEC
int32_t m_iTransmitTimeout;
int32_t m_iTransmitWait;
int8_t m_iTransmitRetries;
int32_t m_iTransmitTimeout;
int32_t m_iTransmitWait;
int8_t m_iTransmitRetries;
+ bool m_bHandlerInited;
CMutex m_receiveMutex;
CCondition m_condition;
};
CMutex m_receiveMutex;
CCondition m_condition;
};
diff --git
a/src/lib/implementations/SLCommandHandler.cpp
b/src/lib/implementations/SLCommandHandler.cpp
index e63f1bb08a2df0db064fdb151ec1e71c4a138c98..f86a644f2db452804a19baa3c32f4e37fa83d7ba 100644
(file)
--- a/
src/lib/implementations/SLCommandHandler.cpp
+++ b/
src/lib/implementations/SLCommandHandler.cpp
@@
-246,6
+246,10
@@
bool CSLCommandHandler::HandleReceiveFailed(void)
bool CSLCommandHandler::InitHandler(void)
{
bool CSLCommandHandler::InitHandler(void)
{
+ if (m_bHandlerInited)
+ return true;
+ m_bHandlerInited = true;
+
m_processor->SetStandardLineTimeout(3);
m_processor->SetRetryLineTimeout(3);
m_processor->SetStandardLineTimeout(3);
m_processor->SetRetryLineTimeout(3);