+ if (m_vendor != m_handler->GetVendorId())
+ {
+ if (CCECCommandHandler::HasSpecificHandler(m_vendor))
+ {
+ CStdString strLog;
+ if (m_handler->InUse())
+ {
+ CLibCEC::AddLog(CEC_LOG_DEBUG, "handler for device '%s' (%x) is being used. not replacing the command handler", GetLogicalAddressName(), GetLogicalAddress());
+ return false;
+ }
+
+ CLibCEC::AddLog(CEC_LOG_DEBUG, "replacing the command handler for device '%s' (%x)", GetLogicalAddressName(), GetLogicalAddress());
+ delete m_handler;
+
+ switch (m_vendor)
+ {
+ case CEC_VENDOR_SAMSUNG:
+ m_handler = new CANCommandHandler(this);
+ break;
+ case CEC_VENDOR_LG:
+ m_handler = new CSLCommandHandler(this);
+ break;
+ case CEC_VENDOR_PANASONIC:
+ m_handler = new CVLCommandHandler(this);
+ break;
+ default:
+ m_handler = new CCECCommandHandler(this);
+ break;
+ }
+
+ m_handler->SetVendorId(m_vendor);
+ m_handler->InitHandler();
+
+ if (bActivateSource && m_processor->GetLogicalAddresses().IsSet(m_iLogicalAddress) && m_processor->IsInitialised() && IsActiveSource())
+ m_handler->ActivateSource();
+ }
+ }
+
+ return true;