Mercurial > hg > svcore
comparison plugin/DSSIPluginInstance.cpp @ 973:7aa9088e9bcd
Fix various slightly dodgy derefs and the like (from coverity scan)
author | Chris Cannam |
---|---|
date | Wed, 03 Sep 2014 11:20:18 +0100 |
parents | 2d53205f70cd |
children | c598b1d880f2 |
comparison
equal
deleted
inserted
replaced
972:a0573186435e | 973:7aa9088e9bcd |
---|---|
62 int idealChannelCount, | 62 int idealChannelCount, |
63 const DSSI_Descriptor* descriptor) : | 63 const DSSI_Descriptor* descriptor) : |
64 RealTimePluginInstance(factory, identifier), | 64 RealTimePluginInstance(factory, identifier), |
65 m_client(clientId), | 65 m_client(clientId), |
66 m_position(position), | 66 m_position(position), |
67 m_instanceHandle(0), | |
67 m_descriptor(descriptor), | 68 m_descriptor(descriptor), |
68 m_programCacheValid(false), | 69 m_programCacheValid(false), |
69 m_eventBuffer(EVENT_BUFFER_SIZE), | 70 m_eventBuffer(EVENT_BUFFER_SIZE), |
70 m_blockSize(blockSize), | 71 m_blockSize(blockSize), |
71 m_idealChannelCount(idealChannelCount), | 72 m_idealChannelCount(idealChannelCount), |
144 DSSIPluginInstance::ParameterList | 145 DSSIPluginInstance::ParameterList |
145 DSSIPluginInstance::getParameterDescriptors() const | 146 DSSIPluginInstance::getParameterDescriptors() const |
146 { | 147 { |
147 ParameterList list; | 148 ParameterList list; |
148 LADSPAPluginFactory *f = dynamic_cast<LADSPAPluginFactory *>(m_factory); | 149 LADSPAPluginFactory *f = dynamic_cast<LADSPAPluginFactory *>(m_factory); |
150 if (!f) return list; | |
149 | 151 |
150 for (unsigned int i = 0; i < m_controlPortsIn.size(); ++i) { | 152 for (unsigned int i = 0; i < m_controlPortsIn.size(); ++i) { |
151 | 153 |
152 ParameterDescriptor pd; | 154 ParameterDescriptor pd; |
153 unsigned int pn = m_controlPortsIn[i].first; | 155 unsigned int pn = m_controlPortsIn[i].first; |
986 int evCount = 0; | 988 int evCount = 0; |
987 | 989 |
988 if (count == 0) count = m_blockSize; | 990 if (count == 0) count = m_blockSize; |
989 | 991 |
990 bool needLock = false; | 992 bool needLock = false; |
991 if (m_descriptor->select_program) needLock = true; | 993 if (m_descriptor && m_descriptor->select_program) needLock = true; |
992 | 994 |
993 if (needLock) { | 995 if (needLock) { |
994 if (!m_processLock.tryLock()) { | 996 if (!m_processLock.tryLock()) { |
995 for (size_t ch = 0; ch < m_audioPortsOut.size(); ++ch) { | 997 for (size_t ch = 0; ch < m_audioPortsOut.size(); ++ch) { |
996 memset(m_outputBuffers[ch], 0, m_blockSize * sizeof(sample_t)); | 998 memset(m_outputBuffers[ch], 0, m_blockSize * sizeof(sample_t)); |