From: Lars Op den Kamp Date: Tue, 20 Dec 2011 23:11:19 +0000 (+0100) Subject: cec: don't transmit active source messages when the physical address is still 0xFFFF X-Git-Tag: upstream/2.2.0~1^2~43^2~31 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d383d6d0c456a4a99ee840576b19e841d6d1ae2d;p=deb_libcec.git cec: don't transmit active source messages when the physical address is still 0xFFFF --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 2c0f876..cb6729c 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -334,12 +334,15 @@ bool CCECProcessor::SetActiveSource(cec_device_type type /* = CEC_DEVICE_TYPE_RE } m_busDevices[addr]->SetActiveSource(); - 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)) + if (m_busDevices[addr]->GetPhysicalAddress(false) != 0xFFFF) { - bReturn = ((CCECPlaybackDevice *)m_busDevices[addr])->TransmitDeckStatus(CECDEVICE_TV); + 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)) + { + bReturn = ((CCECPlaybackDevice *)m_busDevices[addr])->TransmitDeckStatus(CECDEVICE_TV); + } } return bReturn;