From: Matus Kral Date: Sun, 25 May 2014 05:03:32 +0000 (+0200) Subject: this solves problem with device dissapearing from TV's menu X-Git-Tag: upstream/2.2.0~1^2~1^2~3^2~11^2~2 X-Git-Url: https://git.piment-noir.org/?p=deb_libcec.git;a=commitdiff_plain;h=5d9e4ee8e7ebd6354d720476ab9ebebbc81bddb0 this solves problem with device dissapearing from TV's menu when source is changed to another device. (needs fix on adapter side to correctly mark devices with "ishandledbycec"). --- diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 29d1ffb..a89ebe6 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -592,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; }