From: Lars Op den Kamp Date: Wed, 14 Nov 2012 01:21:34 +0000 (+0100) Subject: fixed - update the active source status correct on stream path changes X-Git-Tag: upstream/2.2.0~1^2~12^2~23 X-Git-Url: https://git.piment-noir.org/?p=deb_libcec.git;a=commitdiff_plain;h=88d5d47fe5b37b8fab796e0ec563176bf05b3801 fixed - update the active source status correct on stream path changes --- diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index ad24887..3423c28 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -573,11 +573,21 @@ int CCECCommandHandler::HandleSetStreamPath(const cec_command &command) /* one of the device handled by libCEC has been made active */ CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamAddress); - if (device && device->IsHandledByLibCEC()) + if (device) { - device->ActivateSource(); + if (device->IsHandledByLibCEC()) + device->ActivateSource(); + else + device->MarkAsActiveSource(); return COMMAND_HANDLED; } + else + { + cec_logical_address previousSource = m_processor->GetActiveSource(false); + CCECBusDevice* device = m_processor->GetDevice(previousSource); + if (device && device->GetCurrentPhysicalAddress() != iStreamAddress) + device->MarkAsInactiveSource(); + } } return CEC_ABORT_REASON_INVALID_OPERAND;