From c39611ec27f44e2db11f57045d0284671ac9b3af Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Tue, 14 Feb 2012 15:40:28 +0100 Subject: [PATCH] cec: ensure that there always is at least one device type set --- src/lib/CECProcessor.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 0ec1ef7..cc9936e 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -63,6 +63,8 @@ CCECProcessor::CCECProcessor(CLibCEC *controller, const libcec_configuration *co m_clientVersion(configuration->clientVersion), m_wakeDevices(configuration->wakeDevices) { + if (m_types.IsEmpty()) + m_types.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE); m_logicalAddresses.Clear(); CreateBusDevices(); if (configuration->tvVendor != CEC_VENDOR_UNKNOWN) @@ -87,6 +89,8 @@ CCECProcessor::CCECProcessor(CLibCEC *controller, const char *strDeviceName, con m_iLastTransmission(0), m_clientVersion(clientVersion) { + if (m_types.IsEmpty()) + m_types.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE); m_wakeDevices.Clear(); m_logicalAddresses.Clear(); CreateBusDevices(); @@ -394,6 +398,12 @@ bool CCECProcessor::FindLogicalAddresses(void) bool bReturn(true); m_logicalAddresses.Clear(); + if (m_types.IsEmpty()) + { + CLibCEC::AddLog(CEC_LOG_ERROR, "no device types set"); + return false; + } + for (unsigned int iPtr = 0; iPtr < 5; iPtr++) { if (m_types.types[iPtr] == CEC_DEVICE_TYPE_RESERVED) -- 2.34.1