cec: cleanups, documentation and some fixes for the last commits
[deb_libcec.git] / src / lib / devices / CECBusDevice.cpp
index ca66a464e1d2c7da17a2cf5b045420cae2dabfda..9ce80fbbe139331c2f666ea9c8389e25248806d3 100644 (file)
@@ -404,6 +404,12 @@ bool CCECBusDevice::TransmitOSDString(const cec_logical_address destination, cec
   return bReturn;
 }
 
+CStdString CCECBusDevice::GetCurrentOSDName(void)
+{
+  CLockObject lock(m_mutex);
+  return m_strDeviceName;
+}
+
 CStdString CCECBusDevice::GetOSDName(const cec_logical_address initiator, bool bUpdate /* = false */)
 {
   bool bIsPresent(GetStatus() == CEC_DEVICE_STATUS_PRESENT);
@@ -998,6 +1004,9 @@ void CCECBusDevice::SetStreamPath(uint16_t iNewAddress, uint16_t iOldAddress /*
     m_iStreamPath = iNewAddress;
   }
 
+  if (!LIB_CEC->IsValidPhysicalAddress(iNewAddress))
+    return;
+
   CCECBusDevice *device = m_processor->GetDeviceByPhysicalAddress(iNewAddress);
   if (device)
   {