cec: fixed - mark a device as active source before transmitting the active source...
[deb_libcec.git] / src / lib / implementations / SLCommandHandler.cpp
index fbc6b52dcb0d8879234e7bebc77a4a7dca3a9d8e..0f007176d623f9e83732abbef114790b97446d28 100644 (file)
@@ -119,7 +119,7 @@ void CSLCommandHandler::TransmitVendorCommand0205(const cec_logical_address iSou
   Transmit(response);
 }
 
-void CSLCommandHandler::TransmitVendorCommand04(const cec_logical_address iSource, const cec_logical_address iDestination)
+void CSLCommandHandler::TransmitVendorCommand05(const cec_logical_address iSource, const cec_logical_address iDestination)
 {
   m_bSLEnabled = true;
   cec_command response;
@@ -145,9 +145,9 @@ void CSLCommandHandler::HandleVendorCommandPowerOn(const cec_command &command)
 void CSLCommandHandler::HandleVendorCommandSLConnect(const cec_command &command)
 {
   m_bSLEnabled = true;
+  m_processor->m_busDevices[command.initiator]->SetActiveSource();
   m_processor->m_busDevices[command.destination]->TransmitActiveSource();
-  m_processor->SetStreamPath(m_processor->m_busDevices[command.destination]->GetPhysicalAddress(false));
-  TransmitVendorCommand04(command.destination, command.initiator);
+  TransmitVendorCommand05(command.destination, command.initiator);
   TransmitDeckStatus(command.initiator);
 }
 
@@ -256,7 +256,10 @@ bool CSLCommandHandler::InitHandler(void)
 
   CCECBusDevice *primary = m_processor->m_busDevices[m_processor->GetLogicalAddresses().primary];
   if (m_busDevice->GetLogicalAddress() != primary->GetLogicalAddress())
+  {
     primary->SetVendorId(CEC_VENDOR_LG, false);
+    primary->TransmitVendorID(CECDEVICE_TV, false);
+  }
 
   if (m_busDevice->GetLogicalAddress() == CECDEVICE_TV)
   {
@@ -286,6 +289,7 @@ bool CSLCommandHandler::InitHandler(void)
                        device->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE))
         {
           ((CCECPlaybackDevice *)device)->SetDeckStatus(CEC_DECK_INFO_OTHER_STATUS_LG);
+          ((CCECPlaybackDevice *)device)->TransmitDeckStatus(CECDEVICE_TV);
         }
       }
     }