X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECProcessor.cpp;h=5071ec6ee3f8b87818b8f5733694fedf030126d2;hb=5d0c1164b53973b5866892dc54b4ac00911000c6;hp=6b401252f2bf289d958b4c69aecbcf4a13b3f7b9;hpb=bebb19dc6b8a478b09e8023cc1cfdf670044f4ab;p=deb_libcec.git diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 6b40125..5071ec6 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -417,7 +417,16 @@ bool CCECProcessor::SetActiveSource(cec_device_type type /* = CEC_DEVICE_TYPE_RE m_busDevices[addr]->SetActiveSource(); if (m_busDevices[addr]->GetPhysicalAddress(false) != 0xFFFF) - bReturn = m_busDevices[addr]->GetHandler()->ActivateSource(); + { + bReturn = m_busDevices[addr]->TransmitActiveSource(); + + if (bReturn && (m_busDevices[addr]->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE || + m_busDevices[addr]->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE) && + m_busDevices[addr]->GetHandler()->SendDeckStatusUpdateOnActiveSource()) + { + bReturn = ((CCECPlaybackDevice *)m_busDevices[addr])->TransmitDeckStatus(CECDEVICE_TV); + } + } return bReturn; } @@ -488,14 +497,12 @@ bool CCECProcessor::SetDeckInfo(cec_deck_info info, bool bSendUpdate /* = true * bool CCECProcessor::SetHDMIPort(cec_logical_address iBaseDevice, uint8_t iPort, bool bForce /* = false */) { bool bReturn(false); - { - CLockObject lock(&m_mutex); + CLockObject lock(&m_mutex); - m_iBaseDevice = iBaseDevice; - m_iHDMIPort = iPort; - if (!m_bStarted && !bForce) - return true; - } + m_iBaseDevice = iBaseDevice; + m_iHDMIPort = iPort; + if (!m_bStarted && !bForce) + return true; CStdString strLog; strLog.Format("setting HDMI port to %d on device %s (%d)", iPort, ToString(iBaseDevice), (int)iBaseDevice); @@ -503,7 +510,11 @@ bool CCECProcessor::SetHDMIPort(cec_logical_address iBaseDevice, uint8_t iPort, uint16_t iPhysicalAddress(0); if (iBaseDevice > CECDEVICE_TV) + { + lock.Leave(); iPhysicalAddress = m_busDevices[iBaseDevice]->GetPhysicalAddress(); + lock.Lock(); + } if (iPhysicalAddress < 0xffff) {