Merge pull request #70514 from stmSi/fix-editor-hanging-audio-pitch-scale-nan

[3.x] Fix hanging if audiostream's pitch_scale is NaN
This commit is contained in:
Rémi Verschelde 2023-02-17 12:15:27 +01:00
commit 89788cdcc2
No known key found for this signature in database
GPG Key ID: C3336907360768E1
4 changed files with 4 additions and 4 deletions

View File

@ -320,7 +320,7 @@ float AudioStreamPlayer2D::get_volume_db() const {
}
void AudioStreamPlayer2D::set_pitch_scale(float p_pitch_scale) {
ERR_FAIL_COND(p_pitch_scale <= 0.0);
ERR_FAIL_COND(!(p_pitch_scale > 0.0));
pitch_scale = p_pitch_scale;
}
float AudioStreamPlayer2D::get_pitch_scale() const {

View File

@ -679,7 +679,7 @@ float AudioStreamPlayer3D::get_max_db() const {
}
void AudioStreamPlayer3D::set_pitch_scale(float p_pitch_scale) {
ERR_FAIL_COND(p_pitch_scale <= 0.0);
ERR_FAIL_COND(!(p_pitch_scale > 0.0));
pitch_scale = p_pitch_scale;
}
float AudioStreamPlayer3D::get_pitch_scale() const {

View File

@ -231,7 +231,7 @@ float AudioStreamPlayer::get_volume_db() const {
}
void AudioStreamPlayer::set_pitch_scale(float p_pitch_scale) {
ERR_FAIL_COND(p_pitch_scale <= 0.0);
ERR_FAIL_COND(!(p_pitch_scale > 0.0));
pitch_scale = p_pitch_scale;
}
float AudioStreamPlayer::get_pitch_scale() const {

View File

@ -310,7 +310,7 @@ Ref<AudioEffectInstance> AudioEffectPitchShift::instance() {
}
void AudioEffectPitchShift::set_pitch_scale(float p_pitch_scale) {
ERR_FAIL_COND(p_pitch_scale <= 0.0);
ERR_FAIL_COND(!(p_pitch_scale > 0.0));
pitch_scale = p_pitch_scale;
}