ソースを参照

Merge pull request #20093 from marcelofg55/audio_stream2d

Fix possible bug with AudioStreamPlayer2D audio position
George Marques 7 年 前
コミット
11c36a939d
1 ファイル変更5 行追加0 行削除
  1. 5 0
      scene/2d/audio_stream_player_2d.cpp

+ 5 - 0
scene/2d/audio_stream_player_2d.cpp

@@ -304,6 +304,11 @@ float AudioStreamPlayer2D::get_pitch_scale() const {
 
 
 void AudioStreamPlayer2D::play(float p_from_pos) {
 void AudioStreamPlayer2D::play(float p_from_pos) {
 
 
+	if (!is_playing()) {
+		// Reset the prev_output_count if the stream is stopped
+		prev_output_count = 0;
+	}
+
 	if (stream_playback.is_valid()) {
 	if (stream_playback.is_valid()) {
 		setplay = p_from_pos;
 		setplay = p_from_pos;
 		output_ready = false;
 		output_ready = false;