Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio Stream Importer playback position is not updated unless playhead is visible #86550

Closed
Tracked by #76797
PanForPancakes opened this issue Dec 27, 2023 · 2 comments · Fixed by #86824
Closed
Tracked by #76797

Comments

@PanForPancakes
Copy link

Tested versions

  • Reproducible in: v4.2.1.stable.official [b09f793] and v4.3.dev1.official [9d1cbab]

System information

Godot v4.2.1.stable - Windows 10.0.22621

Issue description

When imported audio is playing in Audio Stream Importer, unless the playhead is visible, current playback position is not updated.

Steps to reproduce

  • Import audio file into project (tested with >3 minute long .mp3)
  • Double-click on imported file in File System tab to open Audio Stream Importer
  • Press play in bottom-left corner, notice that current playback position in the bottom-right corner is updating
  • Make playhead leave your screen by zooming in and etc., notice that current playback position is no longer updated

Minimal reproduction project (MRP)

N/A

@alessandrofama
Copy link
Contributor

The _current_label doesn't get updated since we return early here:

float ofs_x = (_current - zoom_bar->get_value()) * rect.size.width / zoom_bar->get_page();
if (ofs_x < 0 || ofs_x >= rect.size.width) {
return;
}

Any reason for this or could we set the text of the label before that check?

@akien-mga
Copy link
Member

akien-mga commented Jan 5, 2024

The label could be set before. The early return is presumably to avoid unnecessary computations if there's nothing to display, but if that prevents changing state for a future display, that's a bug.

@akien-mga akien-mga added this to the 4.3 milestone Jan 5, 2024
GuybrushThreepwood-GitHub pushed a commit to GuybrushThreepwood-GitHub/godot that referenced this issue Jan 27, 2024
The current playback position label doesn't get updated if the playhead is not visible. The label is updated in `_draw_indicator()` at the end of the function, but we return early if the calculated offset falls outside the valid range. This fix moves the label updating above this check, ensuring that the label always gets updated regardless of the visibility of the playhead.

Fixes godotengine#86550.
akien-mga pushed a commit to akien-mga/godot that referenced this issue Mar 11, 2024
The current playback position label doesn't get updated if the playhead is not visible. The label is updated in `_draw_indicator()` at the end of the function, but we return early if the calculated offset falls outside the valid range. This fix moves the label updating above this check, ensuring that the label always gets updated regardless of the visibility of the playhead.

Fixes godotengine#86550.

(cherry picked from commit 155bebf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants