From 34b1910cd029f28a80df666fb8d62f2eb80b4464 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 5 Jun 2017 18:52:32 +0200 Subject: [PATCH] SDRdaemonSink: fixed remote address in case FEC is activated --- .../samplesink/sdrdaemonsink/sdrdaemonsinkgui.cpp | 15 ++++++++++----- plugins/samplesink/sdrdaemonsink/udpsinkfec.cpp | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/samplesink/sdrdaemonsink/sdrdaemonsinkgui.cpp b/plugins/samplesink/sdrdaemonsink/sdrdaemonsinkgui.cpp index f963dbcf4..06d68a943 100644 --- a/plugins/samplesink/sdrdaemonsink/sdrdaemonsinkgui.cpp +++ b/plugins/samplesink/sdrdaemonsink/sdrdaemonsinkgui.cpp @@ -550,18 +550,23 @@ void SDRdaemonSinkGui::tick() int samplesCorr = 0; bool quickStart = false; - if (queueLength == 0) + if (queueLength < 2) { samplesCorr = 127*8; quickStart = true; } - else if (queueLength < 5) + else if (queueLength < 8) { - samplesCorr = ((5 - queueLength)*16)/m_nbSinceLastFlowCheck; + samplesCorr = ((8 - queueLength)*16)/m_nbSinceLastFlowCheck; } - else if (queueLength > 5) + else if (queueLength > 8) { - samplesCorr = ((5 - queueLength)*16)/m_nbSinceLastFlowCheck; + samplesCorr = ((8 - queueLength)*16)/m_nbSinceLastFlowCheck; + } + else if (queueLength > 16) + { + samplesCorr = -127*16; + quickStart = true; } if (samplesCorr != 0) diff --git a/plugins/samplesink/sdrdaemonsink/udpsinkfec.cpp b/plugins/samplesink/sdrdaemonsink/udpsinkfec.cpp index 43750e2f2..3637c29fa 100644 --- a/plugins/samplesink/sdrdaemonsink/udpsinkfec.cpp +++ b/plugins/samplesink/sdrdaemonsink/udpsinkfec.cpp @@ -330,7 +330,7 @@ void UDPSinkFECWorker::encodeAndTransmit(UDPSinkFEC::SuperBlock *txBlockx, uint1 // // std::cerr << std::endl; - m_socket.SendDataGram((const void *) &txBlockx[i], (int) UDPSinkFEC::m_udpSize, "127.0.0.1", (uint32_t) m_remotePort); + m_socket.SendDataGram((const void *) &txBlockx[i], (int) UDPSinkFEC::m_udpSize, m_remoteAddress.toStdString(), (uint32_t) m_remotePort); //m_udpSocket->writeDatagram((const char *) &txBlockx[i], (int) UDPSinkFEC::m_udpSize, m_remoteAddress, m_remotePort); usleep(txDelay); }