mirror of https://github.com/godotengine/godot
Fix AudioStreamPlayer2D/3D's `get_playback_position` returning `0` right after calling `seek`
This commit is contained in:
parent
bbc54692c0
commit
99cbcd250a
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -582,6 +582,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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue