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:
parent
b97ab1bd9d
commit
f7e3db53fe
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user