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

do not warn, when requesting the volume from an invalid audio device

Instead, we return a defined value (0.0) and keep quiet otherwise.
This commit is contained in:
Nils Fenner 2016-01-17 11:39:23 +01:00 committed by tux3
parent da6bed19b2
commit ffbd8fba91
No known key found for this signature in database
GPG Key ID: 7E086DD661263264

View File

@ -321,13 +321,12 @@ qreal Audio::outputVolume()
{
QMutexLocker locker(&d->audioLock);
if (!d->alMainSource) {
qWarning("Audio output source not initialized.");
return 0.0;
}
ALfloat volume = 0.0;
ALfloat volume;
alGetListenerf(AL_GAIN, &volume);
if (d->alOutDev) {
alGetListenerf(AL_GAIN, &volume);
CHECK_AL_ERROR;
}
return volume;
}