From 15b8480b2c76eecb5c9c31b88828345eed6224d6 Mon Sep 17 00:00:00 2001 From: Ellen Poe Date: Sun, 14 Feb 2021 20:41:59 -0800 Subject: [PATCH] Return setseek position if one exists in get_playback_position. --- scene/2d/audio_stream_player_2d.cpp | 3 +++ scene/3d/audio_stream_player_3d.cpp | 3 +++ scene/audio/audio_stream_player.cpp | 3 +++ 3 files changed, 9 insertions(+) diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp index 4e7eec906c2..d6f35cc99d5 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 d420bd6075d..65d07031390 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 4f77734b79e..ec0a4b86961 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(); }