cec: allow to override the TV vendor id via the initial configuration
[deb_libcec.git] / src / lib / CECProcessor.cpp
index bf23d94b6863bef1337765c34f174823b25970df..f4e485ac3b6da0a7e3c01462780c037fc744c290 100644 (file)
@@ -64,6 +64,11 @@ CCECProcessor::CCECProcessor(CLibCEC *controller, const libcec_configuration *co
 {
   m_logicalAddresses.Clear();
   CreateBusDevices();
+  if (configuration->tvVendor != CEC_VENDOR_UNKNOWN)
+  {
+    m_busDevices[CECDEVICE_TV]->SetVendorId((uint64_t)configuration->tvVendor);
+    m_busDevices[CECDEVICE_TV]->ReplaceHandler(false);
+  }
 }
 
 CCECProcessor::CCECProcessor(CLibCEC *controller, const char *strDeviceName, const cec_device_type_list &types, uint16_t iPhysicalAddress, cec_client_version clientVersion) :
@@ -459,23 +464,7 @@ bool CCECProcessor::SetActiveSource(cec_device_type type /* = CEC_DEVICE_TYPE_RE
 
   m_busDevices[addr]->SetActiveSource();
   if (m_busDevices[addr]->GetPhysicalAddress(false) != 0xFFFF)
-  {
-    bReturn = m_busDevices[addr]->TransmitImageViewOn() &&
-        m_busDevices[addr]->TransmitActiveSource();
-
-    if (bReturn)
-    {
-      m_busDevices[addr]->SetMenuState(CEC_MENU_STATE_ACTIVATED);
-      m_busDevices[addr]->TransmitMenuState(CECDEVICE_TV);
-    }
-
-    if (bReturn && (m_busDevices[addr]->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE ||
-        m_busDevices[addr]->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE) &&
-        m_busDevices[addr]->GetHandler()->SendDeckStatusUpdateOnActiveSource())
-    {
-      bReturn = ((CCECPlaybackDevice *)m_busDevices[addr])->TransmitDeckStatus(CECDEVICE_TV);
-    }
-  }
+    bReturn = m_busDevices[addr]->ActivateSource();
 
   return bReturn;
 }