1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

style(audio): remove redundant checks in src/audio/audio.cpp

This change removes an unnecessary ternary expression from both
Audio::initInput and Audio::initOutput.
This commit is contained in:
Keegan Drake H.P 2016-10-06 04:26:06 -05:00
parent af37fa7b20
commit 099d7d0ac6

View File

@ -352,10 +352,8 @@ bool Audio::initInput(const QString& deviceName)
const uint32_t chnls = AUDIO_CHANNELS; const uint32_t chnls = AUDIO_CHANNELS;
const ALCsizei bufSize = (frameDuration * sampleRate * 4) / 1000 * chnls; const ALCsizei bufSize = (frameDuration * sampleRate * 4) / 1000 * chnls;
const QByteArray qDevName = deviceName.isEmpty() const QByteArray qDevName = deviceName.toUtf8();
? nullptr const ALchar* tmpDevName = qDevName.isEmpty()
: deviceName.toUtf8();
const ALchar* tmpDevName = deviceName.isEmpty()
? nullptr ? nullptr
: qDevName.constData(); : qDevName.constData();
alInDev = alcCaptureOpenDevice(tmpDevName, sampleRate, stereoFlag, bufSize); alInDev = alcCaptureOpenDevice(tmpDevName, sampleRate, stereoFlag, bufSize);
@ -389,10 +387,8 @@ bool Audio::initOutput(const QString& deviceName)
qDebug() << "Opening audio output" << deviceName; qDebug() << "Opening audio output" << deviceName;
assert(!alOutDev); assert(!alOutDev);
const QByteArray qDevName = deviceName.isEmpty() const QByteArray qDevName = deviceName.toUtf8();
? nullptr const ALchar* tmpDevName = qDevName.isEmpty()
: deviceName.toUtf8();
const ALchar* tmpDevName = deviceName.isEmpty()
? nullptr ? nullptr
: qDevName.constData(); : qDevName.constData();
alOutDev = alcOpenDevice(tmpDevName); alOutDev = alcOpenDevice(tmpDevName);