Merge pull request #70515 from stmSi/fix-hanging-audio-pitch-scale
Fix hanging if audiostream's pitch_scale is NaN
This commit is contained in:
commit
9583c20171
4 changed files with 4 additions and 4 deletions
|
@ -234,7 +234,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;
|
||||
for (Ref<AudioStreamPlayback> &playback : stream_playbacks) {
|
||||
AudioServer::get_singleton()->set_playback_pitch_scale(playback, p_pitch_scale);
|
||||
|
|
|
@ -559,7 +559,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -111,7 +111,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;
|
||||
|
||||
for (Ref<AudioStreamPlayback> &playback : stream_playbacks) {
|
||||
|
|
|
@ -309,7 +309,7 @@ Ref<AudioEffectInstance> AudioEffectPitchShift::instantiate() {
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue