X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FCECCommandHandler.cpp;h=a89ebe6c27ee2bc5fb632a6b26ee29749af3331c;hb=5d9e4ee8e7ebd6354d720476ab9ebebbc81bddb0;hp=12e74e3e31bfded1ffe5406d46c806b43a607739;hpb=d9de2aae6b2f47b8e1faacc69adba7406b9d85f0;p=deb_libcec.git diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 12e74e3..a89ebe6 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -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; } @@ -455,6 +463,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; @@ -577,10 +592,16 @@ int CCECCommandHandler::HandleSetStreamPath(const cec_command &command) CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamAddress); if (device) { - if (device->IsHandledByLibCEC() && !device->IsActiveSource()) - device->ActivateSource(); - else - device->MarkAsActiveSource(); + if (device->IsHandledByLibCEC()) + { + if (!device->IsActiveSource()) + device->ActivateSource(); + else + { + device->MarkAsActiveSource(); + device->TransmitActiveSource(true); + } + } return COMMAND_HANDLED; } }