repositories
/
deb_libcec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
59c9774
)
cec: fixed - use the correct source device for broadcasts
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Fri, 28 Oct 2011 22:45:35 +0000
(
00:45
+0200)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Fri, 28 Oct 2011 22:45:35 +0000
(
00:45
+0200)
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
diff --git
a/src/lib/CECProcessor.cpp
b/src/lib/CECProcessor.cpp
index bb207511f5d277cd5c648185666eeabbb98347e3..4f696fdfa4d3b79e44db321ef216c29f6757da66 100644
(file)
--- a/
src/lib/CECProcessor.cpp
+++ b/
src/lib/CECProcessor.cpp
@@
-49,9
+49,7
@@
CCECProcessor::CCECProcessor(CLibCEC *controller, CAdapterCommunication *serComm
m_bMonitor(false)
{
for (unsigned int iPtr = 0; iPtr < 16; iPtr++)
m_bMonitor(false)
{
for (unsigned int iPtr = 0; iPtr < 16; iPtr++)
- m_busDevices[iPtr] = new CCECBusDevice(this, (cec_logical_address) iPtr, 0);
-
- m_busDevices[m_iLogicalAddress]->SetPhysicalAddress(iPhysicalAddress);
+ m_busDevices[iPtr] = new CCECBusDevice(this, (cec_logical_address) iPtr, iPtr == iLogicalAddress ? iPhysicalAddress : 0);
}
CCECProcessor::~CCECProcessor(void)
}
CCECProcessor::~CCECProcessor(void)
diff --git
a/src/lib/implementations/CECCommandHandler.cpp
b/src/lib/implementations/CECCommandHandler.cpp
index df685bc4731297358623eca56adb24e1a86a464b..e1d34f688acd8f62492a4700b9a0626addc1a6a3 100644
(file)
--- a/
src/lib/implementations/CECCommandHandler.cpp
+++ b/
src/lib/implementations/CECCommandHandler.cpp
@@
-190,7
+190,11
@@
bool CCECCommandHandler::HandleGiveOSDName(const cec_command &command)
bool CCECCommandHandler::HandleGivePhysicalAddress(const cec_command &command)
{
bool CCECCommandHandler::HandleGivePhysicalAddress(const cec_command &command)
{
- return m_busDevice->BroadcastPhysicalAddress();
+ CCECBusDevice *device = GetThisDevice();
+ if (device)
+ return device->BroadcastPhysicalAddress();
+
+ return false;
}
bool CCECCommandHandler::HandleMenuRequest(const cec_command &command)
}
bool CCECCommandHandler::HandleMenuRequest(const cec_command &command)
@@
-209,8
+213,10
@@
bool CCECCommandHandler::HandleRequestActiveSource(const cec_command &command)
CStdString strLog;
strLog.Format(">> %i requests active source", (uint8_t) command.initiator);
m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str());
CStdString strLog;
strLog.Format(">> %i requests active source", (uint8_t) command.initiator);
m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str());
- m_busDevice->BroadcastActiveSource();
- return true;
+ CCECBusDevice *device = GetThisDevice();
+ if (device)
+ return device->BroadcastActiveSource();
+ return false;
}
bool CCECCommandHandler::HandleRoutingChange(const cec_command &command)
}
bool CCECCommandHandler::HandleRoutingChange(const cec_command &command)
@@
-236,7
+242,12
@@
bool CCECCommandHandler::HandleSetStreamPath(const cec_command &command)
strLog.Format(">> %i requests stream path from physical address %04x", command.initiator, streamaddr);
m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str());
if (streamaddr == m_busDevice->GetMyPhysicalAddress())
strLog.Format(">> %i requests stream path from physical address %04x", command.initiator, streamaddr);
m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str());
if (streamaddr == m_busDevice->GetMyPhysicalAddress())
- m_busDevice->BroadcastActiveSource();
+ {
+ CCECBusDevice *device = GetThisDevice();
+ if (device)
+ return device->BroadcastActiveSource();
+ return false;
+ }
}
return true;
}
}
return true;
}
@@
-279,3
+290,8
@@
CCECBusDevice *CCECCommandHandler::GetDevice(cec_logical_address iLogicalAddress
return device;
}
return device;
}
+
+CCECBusDevice *CCECCommandHandler::GetThisDevice(void) const
+{
+ return m_busDevice->GetProcessor()->m_busDevices[m_busDevice->GetMyLogicalAddress()];
+}
diff --git
a/src/lib/implementations/CECCommandHandler.h
b/src/lib/implementations/CECCommandHandler.h
index 70c86eb2476ebab0f526468fa4f1294f2b5909a5..0da4dede4cc27b9748b99497b2af9fbd85344595 100644
(file)
--- a/
src/lib/implementations/CECCommandHandler.h
+++ b/
src/lib/implementations/CECCommandHandler.h
@@
-64,6
+64,7
@@
namespace CEC
void UnhandledCommand(const cec_command &command);
CCECBusDevice *GetDevice(cec_logical_address iLogicalAddress) const;
void UnhandledCommand(const cec_command &command);
CCECBusDevice *GetDevice(cec_logical_address iLogicalAddress) const;
+ CCECBusDevice *GetThisDevice(void) const;
CCECBusDevice *m_busDevice;
};
};
CCECBusDevice *m_busDevice;
};
};