cec: only set the osd name for the primary device. use default values for others
[deb_libcec.git] / src / lib / devices / CECBusDevice.cpp
index 2a0dc89b552476061e8ff47e2f9d89e0766c96a1..f9f1a2ac0a8bbee84769a7be9e516b491acb3766 100644 (file)
@@ -338,15 +338,14 @@ bool CCECBusDevice::ReportMenuState(cec_logical_address dest, bool bActive /* =
 
 bool CCECBusDevice::ReportOSDName(cec_logical_address dest)
 {
-  const char *osdname = m_processor->GetDeviceName().c_str();
   CStdString strLog;
-  strLog.Format("<< reporting OSD name as %s", osdname);
+  strLog.Format("<< reporting OSD name as %s", m_strDeviceName.c_str());
   AddLog(CEC_LOG_NOTICE, strLog.c_str());
 
   cec_command command;
   cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_SET_OSD_NAME);
-  for (unsigned int iPtr = 0; iPtr < strlen(osdname); iPtr++)
-    command.parameters.push_back(osdname[iPtr]);
+  for (unsigned int iPtr = 0; iPtr < m_strDeviceName.length(); iPtr++)
+    command.parameters.push_back(m_strDeviceName.at(iPtr));
 
   return m_processor->Transmit(command);
 }