summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJörgen Scott <jorgen.scott@gmail.com>2015-02-09 10:17:01 +0100
committerJörgen Scott <jorgen.scott@gmail.com>2015-02-09 10:17:01 +0100
commite8e7350db3bbf1d408ca4b305329c17d545c91eb (patch)
tree8deeae28fd4119465dcfe1fd202badf9bb2ee853 /src
parent1ab555f832c764bd10cebeeee51d9f7ad5c4b2c6 (diff)
downloaddabmod-e8e7350db3bbf1d408ca4b305329c17d545c91eb.tar.gz
dabmod-e8e7350db3bbf1d408ca4b305329c17d545c91eb.tar.bz2
dabmod-e8e7350db3bbf1d408ca4b305329c17d545c91eb.zip
Bug fix for static delay
Diffstat (limited to 'src')
-rw-r--r--src/OutputUHD.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/OutputUHD.cpp b/src/OutputUHD.cpp
index 91c030f..3845439 100644
--- a/src/OutputUHD.cpp
+++ b/src/OutputUHD.cpp
@@ -341,7 +341,7 @@ int OutputUHD::process(Buffer* dataIn, Buffer* dataOut)
myEtiReader->sourceContainsTimestamp();
// calculate delay
- uint32_t noSampleDelay = (myStaticDelayUs * myConf.sampleRate / 1000) / 1000;
+ uint32_t noSampleDelay = (myStaticDelayUs * (myConf.sampleRate / 1000)) / 1000;
uint32_t noByteDelay = noSampleDelay * sizeof(complexf);
uint8_t* pInData = (uint8_t*) dataIn->getData();
@@ -690,10 +690,10 @@ void OutputUHD::set_parameter(const string& parameter, const string& value)
int adjust;
ss >> adjust;
int newStaticDelayUs = myStaticDelayUs + adjust;
- if (newStaticDelayUs > myTFDurationMs * 1000)
- myStaticDelayUs = newStaticDelayUs - myTFDurationMs * 1000;
+ if (newStaticDelayUs > (myTFDurationMs * 1000))
+ myStaticDelayUs = newStaticDelayUs - (myTFDurationMs * 1000);
else if (newStaticDelayUs < 0)
- myStaticDelayUs = newStaticDelayUs + myTFDurationMs * 1000;
+ myStaticDelayUs = newStaticDelayUs + (myTFDurationMs * 1000);
else
myStaticDelayUs = newStaticDelayUs;
}