From: Lars Op den Kamp Date: Tue, 14 Feb 2012 14:40:28 +0000 (+0100) Subject: cec: ensure that there always is at least one device type set X-Git-Tag: upstream/2.2.0~1^2~35^2~55 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c39611ec27f44e2db11f57045d0284671ac9b3af;p=deb_libcec.git cec: ensure that there always is at least one device type set --- 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)