Skip to content

Commit c7c4c82

Browse files
authored
Merge pull request #706 from jwmay2012/fix/onregister-preserve-basedevice
fixed: OnRegister clears baseDevice when physical address already resolved
2 parents bd0bf7c + 2a5d737 commit c7c4c82

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/libcec/CECClient.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,10 @@ bool CCECClient::OnRegister(void)
136136
(*it)->SetMenuLanguage(std::string(m_configuration.strDeviceLanguage, 3));
137137
}
138138

139-
// set the physical address
140-
SetPhysicalAddress(m_configuration);
139+
// set the physical address, unless already resolved (e.g. via SetHDMIPort during RegisterClient)
140+
if (!CLibCEC::IsValidPhysicalAddress(m_configuration.iPhysicalAddress) ||
141+
m_configuration.iPhysicalAddress == CEC_PHYSICAL_ADDRESS_TV)
142+
SetPhysicalAddress(m_configuration);
141143

142144
// make the primary device the active source if the option is set
143145
if (m_configuration.bActivateSource == 1)

0 commit comments

Comments
 (0)