X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fimplementations%2FCECCommandHandler.cpp;h=c7b030543ca044a137b78e8947009e98fabb39c7;hb=37b0c5724f06a98e14686695b5089f66ac657f11;hp=c58a606a1f69a8f0349a17091f4a630a0f642aa6;hpb=fe6f8e370bff46ba50defc31698f369763c68455;p=deb_libcec.git diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index c58a606..c7b0305 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -178,7 +178,7 @@ bool CCECCommandHandler::HandleActiveSource(const cec_command &command) if (command.parameters.size == 2) { uint16_t iAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]); - return m_processor->SetStreamPath(iAddress); + return m_processor->SetActiveSource(iAddress); } return true; @@ -319,7 +319,7 @@ bool CCECCommandHandler::HandleGiveSystemAudioModeStatus(const cec_command &comm bool CCECCommandHandler::HandleImageViewOn(const cec_command &command) { - m_processor->SetStreamPath(m_processor->m_busDevices[command.initiator]->GetPhysicalAddress(false)); + m_processor->m_busDevices[command.initiator]->SetActiveSource(); return true; } @@ -409,7 +409,7 @@ bool CCECCommandHandler::HandleRoutingInformation(const cec_command &command) if (command.parameters.size == 2) { uint16_t iNewAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]); - m_processor->SetStreamPath(iNewAddress); + m_processor->SetActiveSource(iNewAddress); } return false; @@ -464,14 +464,12 @@ bool CCECCommandHandler::HandleSetStreamPath(const cec_command &command) strLog.Format(">> %i sets stream path to physical address %04x", command.initiator, iStreamAddress); m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str()); - if (m_processor->SetStreamPath(iStreamAddress)) + CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamAddress); + if (device) { - CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamAddress); - if (device) - { - return device->TransmitActiveSource() && - device->TransmitMenuState(command.initiator); - } + device->SetActiveSource(); + return device->TransmitActiveSource() && + device->TransmitMenuState(command.initiator); } } return false; @@ -491,7 +489,7 @@ bool CCECCommandHandler::HandleSystemAudioModeRequest(const cec_command &command uint16_t iNewAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]); CCECBusDevice *newActiveDevice = GetDeviceByPhysicalAddress(iNewAddress); if (newActiveDevice) - m_processor->SetStreamPath(newActiveDevice->GetPhysicalAddress(false)); + newActiveDevice->SetActiveSource(); return ((CCECAudioSystem *) device)->TransmitSetSystemAudioMode(command.initiator); } else @@ -545,7 +543,7 @@ bool CCECCommandHandler::HandleSetSystemAudioMode(const cec_command &command) bool CCECCommandHandler::HandleTextViewOn(const cec_command &command) { - m_processor->SetStreamPath(m_processor->m_busDevices[command.initiator]->GetPhysicalAddress(false)); + m_processor->m_busDevices[command.initiator]->SetActiveSource(); return true; } @@ -899,8 +897,6 @@ bool CCECCommandHandler::TransmitKeyRelease(const cec_logical_address iInitiator bool CCECCommandHandler::Transmit(cec_command &command, bool bExpectResponse /* = true */) { command.transmit_timeout = m_iTransmitTimeout; - if (command.retries == CEC_DEFAULT_TRANSMIT_RETRIES) - command.retries = m_iTransmitRetries; CLockObject writeLock(&m_processor->m_transmitMutex); CLockObject receiveLock(&m_receiveMutex);