From 3af491459e9a60a773d5af74c351dfa202fa44be Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Thu, 2 Aug 2012 17:19:56 +0200 Subject: [PATCH] cec: ensure that the command handler of the tv is replaced before registering a client, or it might result in a double eeprom write attempt --- src/lib/CECProcessor.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 76c2465..db6f8a1 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -665,10 +665,13 @@ bool CCECProcessor::RegisterClient(CCECClient *client) // ensure that we know the vendor id of the TV CCECBusDevice *tv = GetTV(); + cec_vendor_id tvVendor = CEC_VENDOR_UNKNOWN; if (m_communication->SupportsSourceLogicalAddress(CECDEVICE_UNREGISTERED)) - tv->GetVendorId(CECDEVICE_UNREGISTERED); + tvVendor = tv->GetVendorId(CECDEVICE_UNREGISTERED); else if (m_communication->SupportsSourceLogicalAddress(CECDEVICE_FREEUSE)) - tv->GetVendorId(CECDEVICE_FREEUSE); + tvVendor = tv->GetVendorId(CECDEVICE_FREEUSE); + if (tvVendor != CEC_VENDOR_UNKNOWN) + tv->ReplaceHandler(false); // get the configuration from the client m_libcec->AddLog(CEC_LOG_NOTICE, "registering new CEC client - v%s", ToString((cec_client_version)configuration.clientVersion)); -- 2.34.1