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

Fix crash after changing audio track in editor #26219

Merged
merged 3 commits into from
Dec 29, 2023

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Dec 29, 2023

Closes #26213.

Reproduction scenario: switch audio track in editor after timeline loads.

Happens because beatmap.Value.Track.Length is 0 immediately after a track switch, until BASS computes the actual track length on the audio thread.

Yes this is a hack. No I have no better immediate ideas how to address this otherwise.

Closes ppy#26213.

Reproduction scenario: switch audio track in editor after timeline
loads.

Happens because `beatmap.Value.Track.Length` is 0 immediately after a
track switch, until BASS computes the actual track length on the audio
thread.

Yes this is a hack. No I have no better immediate ideas how to address
this otherwise.
@peppy
Copy link
Member

peppy commented Dec 29, 2023

Hmm, is this enough? I thought the track length is obtained on the audio thread, which may not have run in an unlucky scenario.. but maybe I'm wrong.

@bdach
Copy link
Collaborator Author

bdach commented Dec 29, 2023

You're correct. In practice this doesn't end up mattering because the timeline is not present on the setup screen, so the read is delayed until the compose screen is returned to.

Again, yes this is a hack, no I have no better ideas on how to address this quickly.

@peppy
Copy link
Member

peppy commented Dec 29, 2023

So the hope is that track length is populated by the time the user returns to compose?

Might be worth handling the 0 length explicitly in the schedule, just to avoid a crash. Could even just re-schedule if we're feeling lucky.

@bdach
Copy link
Collaborator Author

bdach commented Dec 29, 2023

Sure, see how you find 99cddb6.

@peppy peppy enabled auto-merge December 29, 2023 10:36
@bdach bdach disabled auto-merge December 29, 2023 10:41
@bdach bdach merged commit a9cf909 into ppy:master Dec 29, 2023
13 of 17 checks passed
@bdach bdach deleted the editor-timeline-crash branch December 29, 2023 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System.ArgumentException: X must be finite, but is -∞.
2 participants