cec: don't transmit active source messages when the physical address is still 0xFFFF
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 20 Dec 2011 23:11:19 +0000 (00:11 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Tue, 20 Dec 2011 23:11:19 +0000 (00:11 +0100)
src/lib/CECProcessor.cpp

index 2c0f876a989bb89bcf9678ab029b50e07dfd5689..cb6729c7ede4599d8208dcfd8ea972f40bcdeb83 100644 (file)
@@ -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;