kopia lustrzana https://gitlab.com/eliggett/wfview
remove redundant code from audiohandler
rodzic
90584c5db4
commit
449b017527
|
@ -737,7 +737,7 @@ audioHandler::audioHandler(QObject* parent) :
|
||||||
isUlaw(false),
|
isUlaw(false),
|
||||||
latency(0),
|
latency(0),
|
||||||
isInput(0),
|
isInput(0),
|
||||||
volume(1.0f)
|
chunkAvailable(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -897,11 +897,6 @@ void audioHandler::start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void audioHandler::setVolume(float volume)
|
|
||||||
{
|
|
||||||
volume = volume;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void audioHandler::flush()
|
void audioHandler::flush()
|
||||||
{
|
{
|
||||||
|
@ -941,13 +936,13 @@ qint64 audioHandler::readData(char* data, qint64 maxlen)
|
||||||
|
|
||||||
//qDebug(logAudio()) << "Looking for: " << maxlen << " bytes";
|
//qDebug(logAudio()) << "Looking for: " << maxlen << " bytes";
|
||||||
|
|
||||||
|
// We must lock the mutex for the entire time that the buffer may be modified.
|
||||||
|
QMutexLocker locker(&mutex);
|
||||||
// Get next packet from buffer.
|
// Get next packet from buffer.
|
||||||
if (!audioBuffer.isEmpty())
|
if (!audioBuffer.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
||||||
// We must lock the mutex for the entire time that the buffer may be modified.
|
|
||||||
QMutexLocker locker(&mutex);
|
|
||||||
|
|
||||||
// Output buffer is ALWAYS 16 bit.
|
// Output buffer is ALWAYS 16 bit.
|
||||||
int divisor = 16 / radioSampleBits;
|
int divisor = 16 / radioSampleBits;
|
||||||
|
|
||||||
|
|
|
@ -73,15 +73,15 @@ private:
|
||||||
|
|
||||||
QMutex mutex;
|
QMutex mutex;
|
||||||
|
|
||||||
bool chunkAvailable;
|
|
||||||
bool isInitialized;
|
bool isInitialized;
|
||||||
QAudioOutput* audioOutput;
|
QAudioOutput* audioOutput;
|
||||||
QAudioInput* audioInput;
|
QAudioInput* audioInput;
|
||||||
bool isUlaw;
|
bool isUlaw;
|
||||||
quint16 latency;
|
quint16 latency;
|
||||||
bool isInput; // Used to determine whether input or output audio
|
bool isInput; // Used to determine whether input or output audio
|
||||||
float volume;
|
|
||||||
int chunkSize;
|
int chunkSize;
|
||||||
|
bool chunkAvailable;
|
||||||
|
|
||||||
quint16 lastSeq;
|
quint16 lastSeq;
|
||||||
|
|
||||||
QAudioFormat format;
|
QAudioFormat format;
|
||||||
|
|
Ładowanie…
Reference in New Issue