Release 2.2.0
[deb_libcec.git] / src / lib / implementations / CECCommandHandler.cpp
index ee602f1e6dfa90ecc7242f003fdbba374aeda5a4..a89ebe6c27ee2bc5fb632a6b26ee29749af3331c 100644 (file)
@@ -257,6 +257,14 @@ int CCECCommandHandler::HandleDeviceVendorCommandWithId(const cec_command & UNUS
 int CCECCommandHandler::HandleDeviceVendorId(const cec_command &command)
 {
   SetVendorId(command);
+
+  if (command.initiator == CECDEVICE_TV)
+  {
+    CCECBusDevice* primary = m_processor->GetPrimaryDevice();
+    if (primary)
+      primary->TransmitVendorID(CECDEVICE_BROADCAST, false, false);
+  }
+
   return COMMAND_HANDLED;
 }
 
@@ -584,12 +592,15 @@ int CCECCommandHandler::HandleSetStreamPath(const cec_command &command)
     CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamAddress);
     if (device)
     {
-      if (device->IsHandledByLibCEC() && !device->IsActiveSource())
-        device->ActivateSource();
-      else
+      if (device->IsHandledByLibCEC())
       {
-        device->MarkAsActiveSource();
-        device->TransmitActiveSource(true);
+        if (!device->IsActiveSource())
+          device->ActivateSource();
+        else
+        {
+          device->MarkAsActiveSource();
+          device->TransmitActiveSource(true);
+        }
       }
       return COMMAND_HANDLED;
     }