1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00

SDRdaemon plugin: fixed buffer gauge calculation

This commit is contained in:
Edouard Griffiths 2016-03-18 10:52:35 +01:00
parent b97ab1bd9d
commit f7e3db53fe

View File

@ -88,16 +88,14 @@ public:
{
if (m_rawSize)
{
int32_t val = ((m_writeIndex - m_readIndex) * 100) / m_rawSize;
int32_t val = ((m_writeIndex - m_readIndex) * 100) / (int32_t) m_rawSize;
if (val < -50) {
return val + 100; // read leads (positive)
} else if (val < 0) {
return val; // write leads (negative)
} else if (val < 0.5) {
return val; // read leads (positive)
return val + 100; // read leads (positive)
} else if (val < 50) {
return val; // read leads (positive) or write leads (negative)
} else {
return val - 100; // write leads (negative)
return val - 100; // write leads (negative)
}
}
else