From: curt Date: Sat, 24 Apr 2004 19:47:42 +0000 (+0000) Subject: Clamp pitch values rather than just dumping an error message. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a0bdec284624820feb0a96a06c0c38e2f07d5e4e;p=simgear.git Clamp pitch values rather than just dumping an error message. --- diff --git a/simgear/sound/sample_openal.hxx b/simgear/sound/sample_openal.hxx index fe79cb68..c6411cbd 100644 --- a/simgear/sound/sample_openal.hxx +++ b/simgear/sound/sample_openal.hxx @@ -124,6 +124,9 @@ public: * Set the pitch of this sample. */ inline void set_pitch( double p ) { + // clamp in the range of 0.01 to 2.0 + if ( p < 0.01 ) { p = 0.01; } + if ( p > 2.0 ) { p = 2.0; } pitch = p; alSourcef( source, AL_PITCH, pitch ); if ( alGetError() != AL_NO_ERROR) {