Browse Source

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

Instead, we return a defined value (0.0) and keep quiet otherwise.
pull/2860/head
Nils Fenner 10 years ago committed by tux3
parent
commit
ffbd8fba91
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
  1. 11
      src/audio/audio.cpp

11
src/audio/audio.cpp

@ -321,13 +321,12 @@ qreal Audio::outputVolume() @@ -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;
}

Loading…
Cancel
Save