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. 9
      src/audio/audio.cpp

9
src/audio/audio.cpp

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

Loading…
Cancel
Save