소스 검색

Fix Editor hanging if audiostream's pitch_scale is NaN

stmSi 2 년 전
부모
커밋
28e1fc4af9

+ 1 - 1
scene/2d/audio_stream_player_2d.cpp

@@ -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 {

+ 1 - 1
scene/3d/audio_stream_player_3d.cpp

@@ -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 {

+ 1 - 1
scene/audio/audio_stream_player.cpp

@@ -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 {

+ 1 - 1
servers/audio/effects/audio_effect_pitch_shift.cpp

@@ -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;
 }