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:
eb96547
)
cec: mark the correct device as active source after a stream path change. if the...
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Mon, 19 Mar 2012 14:21:29 +0000
(15:21 +0100)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Mon, 19 Mar 2012 14:21:29 +0000
(15:21 +0100)
src/lib/devices/CECBusDevice.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/lib/devices/CECBusDevice.cpp
b/src/lib/devices/CECBusDevice.cpp
index 429d73fbd162f137870f8c5ed3b479c7fbe80504..814f58a63237b9cbb00456bcd54ace9f2b0cdf88 100644
(file)
--- a/
src/lib/devices/CECBusDevice.cpp
+++ b/
src/lib/devices/CECBusDevice.cpp
@@
-625,6
+625,20
@@
void CCECBusDevice::SetStreamPath(uint16_t iNewAddress, uint16_t iOldAddress /*
CLibCEC::AddLog(CEC_LOG_DEBUG, ">> %s (%X): stream path changed from %04x to %04x", GetLogicalAddressName(), m_iLogicalAddress, iOldAddress == 0 ? m_iStreamPath : iOldAddress, iNewAddress);
m_iStreamPath = iNewAddress;
CLibCEC::AddLog(CEC_LOG_DEBUG, ">> %s (%X): stream path changed from %04x to %04x", GetLogicalAddressName(), m_iLogicalAddress, iOldAddress == 0 ? m_iStreamPath : iOldAddress, iNewAddress);
m_iStreamPath = iNewAddress;
+ CCECBusDevice *device = m_processor->GetDeviceByPhysicalAddress(iNewAddress, false);
+ if (device)
+ {
+ // if a device is found with the new physical address, mark it as active, which will automatically mark all other devices as inactive
+ device->SetActiveSource();
+ }
+ else
+ {
+ // try to find the device with the old address, and mark it as inactive when found
+ device = m_processor->GetDeviceByPhysicalAddress(iOldAddress, false);
+ if (device)
+ device->SetInactiveSource();
+ }
+
if (iNewAddress > 0)
{
lock.Unlock();
if (iNewAddress > 0)
{
lock.Unlock();