diff --git a/src/audio/audio.cpp b/src/audio/audio.cpp index d14dfce40..d825161c1 100644 --- a/src/audio/audio.cpp +++ b/src/audio/audio.cpp @@ -147,8 +147,7 @@ void Audio::SetInputVolume(qreal volume) void Audio::suscribeInput() { - Audio& inst = Audio::getInstance(); - inst.SubscribeInput(); + getInstance().SubscribeInput(); } /** @@ -178,14 +177,13 @@ void Audio::SubscribeInput() void Audio::unsuscribeInput() { - Audio& inst = Audio::getInstance(); - inst.UnSubscribeInput(); + getInstance().UnsubscribeInput(); } /** Call once you don't need to capture on the open input device anymore. */ -void Audio::UnSubscribeInput() +void Audio::UnsubscribeInput() { qDebug() << "unsubscribing input" << inputSubscriptions; if (inputSubscriptions > 0) @@ -400,8 +398,7 @@ void Audio::PlayMono16Sound(const QByteArray& data) ALint frequency; alGetBufferi(buffer, AL_FREQUENCY, &frequency); - float duration = (lengthInSamples / static_cast(frequency)) * 1000; - + qreal duration = (lengthInSamples / static_cast(frequency)) * 1000; int remaining = timer->interval(); if (duration > remaining) @@ -526,7 +523,7 @@ Returns true if the output device is open bool Audio::IsOutputClosed() { QMutexLocker locker(&audioOutLock); - return (alOutDev); + return alOutDev; } bool Audio::tryCaptureSamples(uint8_t* buf, int framesize) @@ -575,8 +572,6 @@ void Audio::pauseOutput() void Audio::PauseOutput() { - QMutexLocker lock(&audioOutLock); - qDebug() << "Pause"; if (!inputSubscriptions) closeOutput(); diff --git a/src/audio/audio.h b/src/audio/audio.h index 8c7e5c267..c0e7d89c3 100644 --- a/src/audio/audio.h +++ b/src/audio/audio.h @@ -63,7 +63,7 @@ public: static void suscribeInput(); void SubscribeInput(); static void unsuscribeInput(); - void UnSubscribeInput(); + void UnsubscribeInput(); static void openInput(const QString& inDevDescr); void OpenInput(const QString& inDevDescr);