cec: opcode 0x80 means the stream path changed, not the physical address
[deb_libcec.git] / src / lib / devices / CECBusDevice.cpp
index 77e646174ba5975df4748429d02ad832885881bf..9a33e0de1e4e67cb25537fda9d18103a3143ae62 100644 (file)
@@ -42,6 +42,7 @@ using namespace CEC;
 
 CCECBusDevice::CCECBusDevice(CCECProcessor *processor, cec_logical_address iLogicalAddress, uint16_t iPhysicalAddress) :
   m_iPhysicalAddress(iPhysicalAddress),
+  m_iStreamPath(0),
   m_iLogicalAddress(iLogicalAddress),
   m_powerStatus(CEC_POWER_STATUS_UNKNOWN),
   m_processor(processor),
@@ -254,7 +255,7 @@ void CCECBusDevice::SetMenuLanguage(const cec_menu_language &language)
   }
 }
 
-void CCECBusDevice::SetPhysicalAddress(uint16_t iNewAddress, uint16_t iOldAddress /* = 0 */)
+void CCECBusDevice::SetPhysicalAddress(uint16_t iNewAddress)
 {
   if (iNewAddress > 0)
   {
@@ -266,6 +267,18 @@ void CCECBusDevice::SetPhysicalAddress(uint16_t iNewAddress, uint16_t iOldAddres
   }
 }
 
+void CCECBusDevice::SetStreamPath(uint16_t iNewAddress, uint16_t iOldAddress /* = 0 */)
+{
+  if (iNewAddress > 0)
+  {
+    CStdString strLog;
+    strLog.Format(">> %i stream path from %04x to %04x", m_iLogicalAddress, iOldAddress, iNewAddress);
+    AddLog(CEC_LOG_DEBUG, strLog.c_str());
+
+    m_iStreamPath = iNewAddress;
+  }
+}
+
 void CCECBusDevice::SetPowerStatus(const cec_power_status powerStatus)
 {
   if (m_powerStatus != powerStatus)