From 5c2d6e57b2df88217359b00396f7a18212775f44 Mon Sep 17 00:00:00 2001 From: M0VSE Date: Mon, 4 Apr 2022 00:23:23 +0100 Subject: [PATCH] Fix linux compile --- audiohandler.cpp | 2 -- audiohandler.h | 9 +++++++++ wfview.pro | 1 - 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/audiohandler.cpp b/audiohandler.cpp index 38a85b5..c4243f0 100644 --- a/audiohandler.cpp +++ b/audiohandler.cpp @@ -92,8 +92,6 @@ bool audioHandler::init(audioSetup setupIn) ", uLaw" << setup.ulaw; - ringBuf = new wilt::Ring(setup.latency + 1); // Should be customizable. - tempBuf.sent = 0; if(!setup.isinput) diff --git a/audiohandler.h b/audiohandler.h index be23b6d..87ea3df 100644 --- a/audiohandler.h +++ b/audiohandler.h @@ -45,7 +45,11 @@ typedef signed short MY_TYPE; #endif #include "audiotaper.h" +#ifdef Q_OS_LINUX +#include +#else #include +#endif //#include //#include @@ -165,7 +169,12 @@ private: static inline qint64 getAudioSize(qint64 timeInMs, const QAudioFormat& format) { +#ifdef Q_OS_LINUX + qint64 value = qint64(qCeil(format.channelCount() * (format.sampleSize() / 8) * format.sampleRate() / qreal(1000) * timeInMs)); +#else qint64 value = qint64(qCeil(format.channelCount() * (format.sampleSize() / 8) * format.sampleRate() / qreal(10000) * timeInMs)); +#endif + if (value % (format.channelCount() * (format.sampleSize() / 8)) != 0) value += (format.channelCount() * (format.sampleSize() / 8) - value % (format.channelCount() * (format.sampleSize() / 8))); diff --git a/wfview.pro b/wfview.pro index 48ef479..3d62c22 100644 --- a/wfview.pro +++ b/wfview.pro @@ -206,7 +206,6 @@ HEADERS += wfmain.h \ audiotaper.h \ selectradio.h \ tcpserver.h \ - audiocommon.h \ aboutbox.h