- fix many compiler warnings
This commit is contained in:
@@ -29,10 +29,6 @@ TimeSource::TimeSource(int quantTime, int nrOfQuants)
|
||||
mTailTime = 0;
|
||||
}
|
||||
|
||||
TimeSource::~TimeSource()
|
||||
{
|
||||
}
|
||||
|
||||
void TimeSource::start()
|
||||
{
|
||||
#ifdef TARGET_WIN
|
||||
@@ -107,7 +103,7 @@ unsigned TimeSource::time()
|
||||
|
||||
// --- StubTimer ---
|
||||
StubTimer::StubTimer(int bufferTime, int bufferCount)
|
||||
:mBufferTime(bufferTime), mBufferCount(bufferCount), mTimeSource(bufferTime, bufferCount), mActive(false)
|
||||
:mBufferTime(bufferTime), mBufferCount(bufferCount), mTimeSource(bufferTime, bufferCount), mActive(false), mCurrentTime(0)
|
||||
{
|
||||
#ifdef TARGET_WIN
|
||||
mStubSignal = ::CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Audio
|
||||
|
||||
public:
|
||||
TimeSource(int quantTime, int nrOfQuants);
|
||||
~TimeSource();
|
||||
~TimeSource() = default;
|
||||
|
||||
void start();
|
||||
void stop();
|
||||
|
||||
@@ -60,7 +60,7 @@ NullInputDevice::NullInputDevice()
|
||||
|
||||
NullInputDevice::~NullInputDevice()
|
||||
{
|
||||
close();
|
||||
internalClose();
|
||||
}
|
||||
|
||||
bool NullInputDevice::open()
|
||||
@@ -73,7 +73,7 @@ bool NullInputDevice::open()
|
||||
return true;
|
||||
}
|
||||
|
||||
void NullInputDevice::close()
|
||||
void NullInputDevice::internalClose()
|
||||
{
|
||||
mTimer.reset();
|
||||
if (mBuffer)
|
||||
@@ -84,6 +84,10 @@ void NullInputDevice::close()
|
||||
ICELogInfo(<<"Pseudocaptured " << mTimeCounter << " milliseconds , " << mDataCounter << " bytes.");
|
||||
}
|
||||
|
||||
void NullInputDevice::close()
|
||||
{
|
||||
internalClose();
|
||||
}
|
||||
Format NullInputDevice::getFormat()
|
||||
{
|
||||
assert (Format().sizeFromTime(AUDIO_MIC_BUFFER_LENGTH) == AUDIO_MIC_BUFFER_SIZE);
|
||||
@@ -106,7 +110,7 @@ NullOutputDevice::NullOutputDevice()
|
||||
|
||||
NullOutputDevice::~NullOutputDevice()
|
||||
{
|
||||
close();
|
||||
internalClose();
|
||||
}
|
||||
|
||||
|
||||
@@ -119,13 +123,18 @@ bool NullOutputDevice::open()
|
||||
return true;
|
||||
}
|
||||
|
||||
void NullOutputDevice::close()
|
||||
void NullOutputDevice::internalClose()
|
||||
{
|
||||
mTimer.reset();
|
||||
free(mBuffer); mBuffer = nullptr;
|
||||
ICELogInfo(<< "Pseudoplayed " << mTimeCounter << " milliseconds, " << mDataCounter << " bytes.");
|
||||
}
|
||||
|
||||
void NullOutputDevice::close()
|
||||
{
|
||||
internalClose();
|
||||
}
|
||||
|
||||
Format NullOutputDevice::getFormat()
|
||||
{
|
||||
assert (Format().sizeFromTime(AUDIO_SPK_BUFFER_LENGTH) == AUDIO_SPK_BUFFER_SIZE);
|
||||
|
||||
@@ -38,6 +38,8 @@ namespace Audio
|
||||
void* mBuffer = nullptr;
|
||||
std::shared_ptr<NullTimer> mTimer;
|
||||
int64_t mTimeCounter = 0, mDataCounter = 0;
|
||||
void internalClose();
|
||||
|
||||
public:
|
||||
NullInputDevice();
|
||||
virtual ~NullInputDevice();
|
||||
@@ -55,6 +57,8 @@ namespace Audio
|
||||
std::shared_ptr<NullTimer> mTimer;
|
||||
void* mBuffer = nullptr;
|
||||
int64_t mDataCounter = 0, mTimeCounter = 0;
|
||||
|
||||
void internalClose();
|
||||
public:
|
||||
NullOutputDevice();
|
||||
virtual ~NullOutputDevice();
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Audio
|
||||
|
||||
|
||||
SpeexResampler::SpeexResampler()
|
||||
:mContext(NULL), mErrorCode(0), mSourceRate(0), mDestRate(0), mLastSample(0)
|
||||
:mContext(NULL), mErrorCode(0), mSourceRate(0), mDestRate(0), mLastSample(0), mChannels(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ PResampler UniversalResampler::findResampler(int sourceRate, int destRate)
|
||||
PResampler r;
|
||||
if (resamplerIter == mResamplerMap.end())
|
||||
{
|
||||
r = PResampler(new Resampler());
|
||||
r = std::make_shared<Resampler>();
|
||||
r->start(AUDIO_CHANNELS, sourceRate, destRate);
|
||||
mResamplerMap[RatePair(sourceRate, destRate)] = r;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ using namespace Audio;
|
||||
|
||||
// ---------------------- WavFileReader -------------------------
|
||||
WavFileReader::WavFileReader()
|
||||
:mHandle(nullptr), mSamplerate(0), mLastError(0)
|
||||
:mHandle(nullptr), mSamplerate(0), mLastError(0), mChannels(0), mBits(0), mDataLength(0)
|
||||
{
|
||||
mDataOffset = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user