From 88d5d47fe5b37b8fab796e0ec563176bf05b3801 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Wed, 14 Nov 2012 02:21:34 +0100 Subject: [PATCH] fixed - update the active source status correct on stream path changes --- src/lib/implementations/CECCommandHandler.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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; -- 2.34.1