transmit our physical address when the TV sends it's physical address
[deb_libcec.git] / src / lib / implementations / CECCommandHandler.cpp
index 12e74e3e31bfded1ffe5406d46c806b43a607739..ee602f1e6dfa90ecc7242f003fdbba374aeda5a4 100644 (file)
@@ -455,6 +455,13 @@ int CCECCommandHandler::HandleReportPhysicalAddress(const cec_command &command)
   {
     uint16_t iNewAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
     SetPhysicalAddress(command.initiator, iNewAddress);
+
+    if (command.initiator == CECDEVICE_TV)
+    {
+      CCECBusDevice* primary = m_processor->GetPrimaryDevice();
+      if (primary)
+        primary->TransmitPhysicalAddress(false);
+    }
     return COMMAND_HANDLED;
   }
   return CEC_ABORT_REASON_INVALID_OPERAND;
@@ -580,7 +587,10 @@ int CCECCommandHandler::HandleSetStreamPath(const cec_command &command)
       if (device->IsHandledByLibCEC() && !device->IsActiveSource())
         device->ActivateSource();
       else
+      {
         device->MarkAsActiveSource();
+        device->TransmitActiveSource(true);
+      }
       return COMMAND_HANDLED;
     }
   }