Merge pull request #99759 from Mickeon/audio-stream-player-3d-seek-fix-for-real

Fix AudioStreamPlayer2D/3D's `get_playback_position` returning `0` right after calling `seek`
This commit is contained in:
Rémi Verschelde 2024-12-02 15:51:38 +01:00
commit ca1440fafb
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 6 additions and 0 deletions

View File

@ -253,6 +253,9 @@ bool AudioStreamPlayer2D::is_playing() const {
}
float AudioStreamPlayer2D::get_playback_position() {
if (setplay.get() >= 0) {
return setplay.get(); // play() has been called this frame, but no playback exists just yet.
}
return internal->get_playback_position();
}

View File

@ -579,6 +579,9 @@ bool AudioStreamPlayer3D::is_playing() const {
}
float AudioStreamPlayer3D::get_playback_position() {
if (setplay.get() >= 0) {
return setplay.get(); // play() has been called this frame, but no playback exists just yet.
}
return internal->get_playback_position();
}