mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-10-08 08:10:35 -04:00
moddatv: Fix GCC uninitialized variable warnings
Handle unsupported modulation and DVB-S code rates in getDVBSDataBitrate() and stop checkBitrates() when no valid bitrate can be calculated. Signed-off-by: Robin Getz <rgetz503@gmail.com>
This commit is contained in:
@@ -251,6 +251,9 @@ int DATVModSettings::getDVBSDataBitrate() const
|
||||
case DATVModSettings::APSK32:
|
||||
bitsPerSymbol = 5.0f;
|
||||
break;
|
||||
default:
|
||||
qWarning("DATVModSettings::getDVBSDataBitrate: Unsupported modulation");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (m_standard == DATVModSettings::DVB_S)
|
||||
@@ -297,6 +300,9 @@ int DATVModSettings::getDVBSDataBitrate() const
|
||||
case DATVModSettings::FEC35:
|
||||
convFactor = 3.0f/5.0f;
|
||||
break;
|
||||
default:
|
||||
qWarning("DATVModSettings::getDVBSDataBitrate: Unsupported DVB-S code rate");
|
||||
return 0;
|
||||
}
|
||||
fecFactor = rsFactor * convFactor;
|
||||
plFactor = 1.0f;
|
||||
|
||||
@@ -214,7 +214,10 @@ void DATVModSource::checkBitrates()
|
||||
qDebug() << "MPEG-TS bitrate: " << m_mpegTSBitrate;
|
||||
qDebug() << "DVB data bitrate: " << dataBitrate;
|
||||
if (dataBitrate <= 0)
|
||||
{
|
||||
qWarning() << "Unable to calculate DVB data bitrate";
|
||||
return;
|
||||
}
|
||||
if (dataBitrate < m_mpegTSBitrate)
|
||||
qWarning() << "DVB data bitrate is lower than the bitrate of the MPEG transport stream";
|
||||
m_tsRatio = m_mpegTSBitrate/(float)dataBitrate;
|
||||
|
||||
Reference in New Issue
Block a user