Merge pull request #46040 from ellenhp/fix_seek_playback_pos

Return setseek position if one exists in get_playback_position.
This commit is contained in:
Rémi Verschelde 2021-02-16 12:19:09 +01:00 committed by GitHub
commit c7444b033e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View file

@ -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();
}

View file

@ -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();
}

View file

@ -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();
}