1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-05-29 05:22:25 -04:00

DATV demod: fixed compilation issue for Qt < 5.14

This commit is contained in:
f4exb 2021-04-12 11:41:21 +02:00
parent dbf64d9a1f
commit bfc013e18a

View File

@ -52,8 +52,11 @@ template<typename T> struct datvvideoplayer: runnable
int nw; int nw;
m_udpStream->pushData((const char *) in.rd(), in.readable()); m_udpStream->pushData((const char *) in.rd(), in.readable());
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
m_atomicUDPRunning.storeRelaxed(m_udpStream->isActive() && (size > 0) ? 1 : 0); m_atomicUDPRunning.storeRelaxed(m_udpStream->isActive() && (size > 0) ? 1 : 0);
#else
m_atomicUDPRunning.store(m_udpStream->isActive() && (size > 0) ? 1 : 0);
#endif
if (m_videoStream) if (m_videoStream)
{ {
nw = m_videoStream->pushData((const char *) in.rd(), size); nw = m_videoStream->pushData((const char *) in.rd(), size);
@ -88,8 +91,23 @@ template<typename T> struct datvvideoplayer: runnable
in.read(nw / sizeof(T)); in.read(nw / sizeof(T));
} }
bool isUDPRunning() const { return m_atomicUDPRunning.loadRelaxed() == 1; } bool isUDPRunning() const
void resetUDPRunning() { m_atomicUDPRunning.storeRelaxed(0); } {
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
return m_atomicUDPRunning.loadRelaxed() == 1;
#else
return m_atomicUDPRunning.load() == 1;
#endif
}
void resetUDPRunning()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
m_atomicUDPRunning.storeRelaxed(0);
#else
m_atomicUDPRunning.store(0);
#endif
}
private: private:
pipereader<T> in; pipereader<T> in;