diff options
author | Ellen Poe <ellen@ellenhp.me> | 2021-02-14 20:41:59 -0800 |
---|---|---|
committer | Ellen Poe <ellen@ellenhp.me> | 2021-02-14 20:41:59 -0800 |
commit | 15b8480b2c76eecb5c9c31b88828345eed6224d6 (patch) | |
tree | 5a90c10ffd844368adb5a39c0d28a643f10dbfef | |
parent | 8fa92c70eacd180866535a42d409e1c9e1074d73 (diff) |
Return setseek position if one exists in get_playback_position.
-rw-r--r-- | scene/2d/audio_stream_player_2d.cpp | 3 | ||||
-rw-r--r-- | scene/3d/audio_stream_player_3d.cpp | 3 | ||||
-rw-r--r-- | scene/audio/audio_stream_player.cpp | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp index 4e7eec906c..d6f35cc99d 100644 --- a/scene/2d/audio_stream_player_2d.cpp +++ b/scene/2d/audio_stream_player_2d.cpp @@ -342,6 +342,9 @@ bool AudioStreamPlayer2D::is_playing() const { float AudioStreamPlayer2D::get_playback_position() { if (stream_playback.is_valid()) { + if (setseek >= 0.0) { + return setseek; + } return stream_playback->get_playback_position(); } diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index d420bd6075..65d0703139 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -714,6 +714,9 @@ bool AudioStreamPlayer3D::is_playing() const { float AudioStreamPlayer3D::get_playback_position() { if (stream_playback.is_valid()) { + if (setseek >= 0.0) { + return setseek; + } return stream_playback->get_playback_position(); } diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp index 4f77734b79..ec0a4b8696 100644 --- a/scene/audio/audio_stream_player.cpp +++ b/scene/audio/audio_stream_player.cpp @@ -267,6 +267,9 @@ bool AudioStreamPlayer::is_playing() const { float AudioStreamPlayer::get_playback_position() { if (stream_playback.is_valid()) { + if (setseek >= 0.0) { + return setseek; + } return stream_playback->get_playback_position(); } |