Fix AudioStreamPlayer.get_playback_position() always returning 0 when using AudioStreamInteractive

This commit is contained in:
Johannes Kung 2024-10-04 10:52:59 +02:00
parent 32239d477b
commit 5255fe8fec

View file

@ -1018,6 +1018,10 @@ int AudioStreamPlaybackInteractive::get_loop_count() const {
}
double AudioStreamPlaybackInteractive::get_playback_position() const {
if (playback_current != -1) {
const State &current_state = states[playback_current];
return current_state.playback->get_playback_position();
}
return 0.0;
}