1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-18 06:11:46 -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,14 +88,12 @@ public:
{ {
if (m_rawSize) 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) { if (val < -50) {
return val + 100; // read leads (positive) return val + 100; // read leads (positive)
} else if (val < 0) { } else if (val < 50) {
return val; // write leads (negative) return val; // read leads (positive) or write leads (negative)
} else if (val < 0.5) {
return val; // read leads (positive)
} else { } else {
return val - 100; // write leads (negative) return val - 100; // write leads (negative)
} }