kopia lustrzana https://gitlab.com/eliggett/wfview
Fix errors identified by clang scan-build
rodzic
54b00b9022
commit
7df55bc41f
|
@ -113,13 +113,7 @@ bool audioConverter::convert(audioPacket audio)
|
|||
QByteArray outPacket(nSamples * sizeof(float) * inFormat.channelCount(), (char)0xff); // Preset the output buffer size.
|
||||
float* out = (float*)outPacket.data();
|
||||
|
||||
//if (audio.seq > lastAudioSequence + 1) {
|
||||
// nSamples = opus_decode_float(opusDecoder, Q_NULLPTR, 0, out, nSamples, 1);
|
||||
//}
|
||||
//else {
|
||||
nSamples = opus_decode_float(opusDecoder, in, audio.data.size(), out, nSamples, 0);
|
||||
//}
|
||||
//lastAudioSequence = audio.seq;
|
||||
opus_decode_float(opusDecoder, in, audio.data.size(), out, nSamples, 0);
|
||||
audio.data.clear();
|
||||
audio.data = outPacket; // Replace incoming data with converted.
|
||||
}
|
||||
|
|
|
@ -493,7 +493,7 @@ void meter::drawScalePo(QPainter *qp)
|
|||
|
||||
// Here, P is now 60 watts:
|
||||
// Higher scale:
|
||||
i = i - (int)(10*dnPerWatt); // back one tick first. Otherwise i starts at 178.
|
||||
//i = i - (int)(10*dnPerWatt); // back one tick first. Otherwise i starts at 178. **Not used?**
|
||||
//qDebug() << "meter i: " << i;
|
||||
dnPerWatt = (213-143.0f) / 50.0f; // 1.4 dn per watt
|
||||
// P=5 here.
|
||||
|
|
|
@ -688,6 +688,7 @@ void repeaterSetup::on_splitPlusButton_clicked()
|
|||
txfreqhz = currentMainFrequency.Hz + hzOffset;
|
||||
f.Hz = txfreqhz;
|
||||
f.VFO = inactiveVFO;
|
||||
f.MHzDouble = f.Hz/1E6;
|
||||
txString = QString::number(f.Hz / double(1E6), 'f', 6);
|
||||
ui->splitTransmitFreqEdit->setText(txString);
|
||||
usedPlusSplit = true;
|
||||
|
@ -707,6 +708,7 @@ void repeaterSetup::on_splitMinusBtn_clicked()
|
|||
txfreqhz = currentMainFrequency.Hz - hzOffset;
|
||||
f.Hz = txfreqhz;
|
||||
f.VFO = inactiveVFO;
|
||||
f.MHzDouble = f.Hz/1E6;
|
||||
txString = QString::number(f.Hz / double(1E6), 'f', 6);
|
||||
ui->splitTransmitFreqEdit->setText(txString);
|
||||
usedPlusSplit = false;
|
||||
|
@ -723,6 +725,7 @@ void repeaterSetup::on_splitTxFreqSetBtn_clicked()
|
|||
{
|
||||
f.Hz = fHz;
|
||||
f.VFO = inactiveVFO;
|
||||
f.MHzDouble = f.Hz/1E6;
|
||||
emit setTransmitFrequency(f);
|
||||
emit setTransmitMode(modeTransmitVFO);
|
||||
}
|
||||
|
@ -812,6 +815,8 @@ void repeaterSetup::on_rptrOffsetSetBtn_clicked()
|
|||
{
|
||||
freqt f;
|
||||
f.Hz = getFreqHzFromMHzString(ui->rptrOffsetEdit->text());
|
||||
f.MHzDouble = f.Hz/1E6;
|
||||
f.VFO=activeVFO;
|
||||
if(f.Hz != 0)
|
||||
{
|
||||
emit setRptDuplexOffset(f);
|
||||
|
|
|
@ -710,7 +710,7 @@ static int update_filter(SpeexResamplerState* st)
|
|||
/* Adding buffer_size to filt_len won't overflow here because filt_len
|
||||
could be multiplied by sizeof(spx_word16_t) above. */
|
||||
min_alloc_size = st->filt_len - 1 + st->buffer_size;
|
||||
if (min_alloc_size > st->mem_alloc_size)
|
||||
if (min_alloc_size > st->mem_alloc_size && st->nb_channels>0)
|
||||
{
|
||||
spx_word16_t* mem;
|
||||
if (INT_MAX / sizeof(spx_word16_t) / st->nb_channels < min_alloc_size)
|
||||
|
|
|
@ -4773,6 +4773,8 @@ freqt rigCommander::parseFrequencyRptOffset(QByteArray data)
|
|||
f.Hz += (data[1] & 0x0f) * 100; // 100 Hz
|
||||
f.Hz += ((data[1] & 0xf0) >> 4) * 1000; // 1 KHz
|
||||
|
||||
f.MHzDouble=f.Hz/1E6;
|
||||
f.VFO = activeVFO;
|
||||
return f;
|
||||
}
|
||||
|
||||
|
|
|
@ -382,31 +382,32 @@ void udpServer::controlReceived()
|
|||
qCritical(logAudio()) << "Unsupported Transmit Audio Handler selected!";
|
||||
}
|
||||
|
||||
//radio->txaudio = new audioHandler();
|
||||
radio->txAudioThread = new QThread(this);
|
||||
radio->txAudioThread->setObjectName("txAudio()");
|
||||
|
||||
if (radio->txaudio != Q_NULLPTR) {
|
||||
radio->txAudioThread = new QThread(this);
|
||||
radio->txAudioThread->setObjectName("txAudio()");
|
||||
|
||||
|
||||
radio->txaudio->moveToThread(radio->txAudioThread);
|
||||
radio->txaudio->moveToThread(radio->txAudioThread);
|
||||
|
||||
radio->txAudioThread->start(QThread::TimeCriticalPriority);
|
||||
radio->txAudioThread->start(QThread::TimeCriticalPriority);
|
||||
|
||||
connect(this, SIGNAL(setupTxAudio(audioSetup)), radio->txaudio, SLOT(init(audioSetup)));
|
||||
connect(radio->txAudioThread, SIGNAL(finished()), radio->txaudio, SLOT(deleteLater()));
|
||||
connect(this, SIGNAL(setupTxAudio(audioSetup)), radio->txaudio, SLOT(init(audioSetup)));
|
||||
connect(radio->txAudioThread, SIGNAL(finished()), radio->txaudio, SLOT(deleteLater()));
|
||||
|
||||
// Not sure how we make this work in QT5.9?
|
||||
// Not sure how we make this work in QT5.9?
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5,10,0))
|
||||
QMetaObject::invokeMethod(radio->txaudio, [=]() {
|
||||
radio->txaudio->init(radio->txAudioSetup);
|
||||
}, Qt::QueuedConnection);
|
||||
QMetaObject::invokeMethod(radio->txaudio, [=]() {
|
||||
radio->txaudio->init(radio->txAudioSetup);
|
||||
}, Qt::QueuedConnection);
|
||||
#else
|
||||
emit setupTxAudio(radio->txAudioSetup);
|
||||
#warning "QT 5.9 is not fully supported multiple rigs will NOT work!"
|
||||
emit setupTxAudio(radio->txAudioSetup);
|
||||
#warning "QT 5.9 is not fully supported multiple rigs will NOT work!"
|
||||
#endif
|
||||
hasTxAudio = datagram.senderAddress();
|
||||
|
||||
connect(this, SIGNAL(haveAudioData(audioPacket)), radio->txaudio, SLOT(incomingAudio(audioPacket)));
|
||||
hasTxAudio = datagram.senderAddress();
|
||||
|
||||
connect(this, SIGNAL(haveAudioData(audioPacket)), radio->txaudio, SLOT(incomingAudio(audioPacket)));
|
||||
}
|
||||
}
|
||||
if ((!memcmp(radio->guid, current->guid, GUIDLEN) || config->rigs.size() == 1) && radio->rxaudio == Q_NULLPTR && !config->lan)
|
||||
{
|
||||
|
@ -431,27 +432,30 @@ void udpServer::controlReceived()
|
|||
qCritical(logAudio()) << "Unsupported Receive Audio Handler selected!";
|
||||
}
|
||||
|
||||
if (radio->rxaudio != Q_NULLPTR)
|
||||
{
|
||||
|
||||
radio->rxAudioThread = new QThread(this);
|
||||
radio->rxAudioThread->setObjectName("rxAudio()");
|
||||
radio->rxAudioThread = new QThread(this);
|
||||
radio->rxAudioThread->setObjectName("rxAudio()");
|
||||
|
||||
radio->rxaudio->moveToThread(radio->rxAudioThread);
|
||||
radio->rxaudio->moveToThread(radio->rxAudioThread);
|
||||
|
||||
radio->rxAudioThread->start(QThread::TimeCriticalPriority);
|
||||
radio->rxAudioThread->start(QThread::TimeCriticalPriority);
|
||||
|
||||
connect(radio->rxAudioThread, SIGNAL(finished()), radio->rxaudio, SLOT(deleteLater()));
|
||||
connect(radio->rxaudio, SIGNAL(haveAudioData(audioPacket)), this, SLOT(receiveAudioData(audioPacket)));
|
||||
connect(radio->rxAudioThread, SIGNAL(finished()), radio->rxaudio, SLOT(deleteLater()));
|
||||
connect(radio->rxaudio, SIGNAL(haveAudioData(audioPacket)), this, SLOT(receiveAudioData(audioPacket)));
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5,10,0))
|
||||
QMetaObject::invokeMethod(radio->rxaudio, [=]() {
|
||||
radio->rxaudio->init(radio->rxAudioSetup);
|
||||
}, Qt::QueuedConnection);
|
||||
QMetaObject::invokeMethod(radio->rxaudio, [=]() {
|
||||
radio->rxaudio->init(radio->rxAudioSetup);
|
||||
}, Qt::QueuedConnection);
|
||||
#else
|
||||
//#warning "QT 5.9 is not fully supported multiple rigs will NOT work!"
|
||||
connect(this, SIGNAL(setupRxAudio(audioSetup)), radio->rxaudio, SLOT(init(audioSetup)));
|
||||
setupRxAudio(radio->rxAudioSetup);
|
||||
//#warning "QT 5.9 is not fully supported multiple rigs will NOT work!"
|
||||
connect(this, SIGNAL(setupRxAudio(audioSetup)), radio->rxaudio, SLOT(init(audioSetup)));
|
||||
setupRxAudio(radio->rxAudioSetup);
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7245,7 +7245,7 @@ void wfmain::receiveModInput(rigInput input, bool dataOn)
|
|||
{
|
||||
QComboBox *box;
|
||||
QString inputName;
|
||||
bool found;
|
||||
bool found=false;
|
||||
bool foundCurrent = false;
|
||||
|
||||
if(dataOn)
|
||||
|
|
Ładowanie…
Reference in New Issue