-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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 ogg edge cases #55846
Fix ogg edge cases #55846
Conversation
0b97c06
to
7fa3ee1
Compare
From just testing the code I can tell that it does indeed correctly play all the ogg files that previously failed to stop. ERROR: Condition "!active" is true. Returning: 0 It still sounds correct and stops. Looks like its because "if (is_playing()) {" was dropped and _mix_internal is called when the stream is no longer playing. |
Oh good catch, I should make the same change to the MP3 stream. This change brings things more in line with the way I envisioned everything working when I did the audio server rewrite. The audio server attempts to mix a certain number of samples, and the stream playback can simply refuse to do the mix, if it's unable, which will cause the audio server to fade-out the playback to silence and then stop it completely. |
Ok, I see what you mean now, audio_stream_mp3.cpp should also return 0 when !active. |
Thanks! I'll update MP3 streams sometime today then get an official maintainer review after that. There does seem to be one last issue that I can only reproduce by selecting an ogg stream in the editor then clicking on the play/pause button as fast as I can. It's a crashing bug related to exhausting the ogg packet stream, then pausing, then playing. I'll make a new issue for it. |
When you're ready, post your pr for review. I'll try to gather the relevant parties. |
7fa3ee1
to
afd2bba
Compare
I think this is ready now. |
Thanks! |
@ellenhp It looks like the change here (specifically to the |
This should fix the edge cases described in the comments of #55820. This PR needs testing and issues tracking each edge case to be created and linked before review/merging.
In its current state, this PR is just an attempt at simplifying some of the logic in the AudioStreamPlaybackResampled class and its Ogg implementation. A few things I was doing before that were error-prone have been removed. It's not perfect but I think it's a step in the right direction.
Bugsquad edit: Fix #55849, Fix #55848