-
Notifications
You must be signed in to change notification settings - Fork 10
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
"event post blocked" when music finishes playing #34
Comments
Thanks for the bug report. Part of the problem is obvious: We shouldn't be raising an exception here - that part of the code should simply drop the event and return to match pygame's behaviour. However, we should only hit this exception if the event has been blocked explicity. Given that you're expecting to see the event, it sounds like that isn't the case, which suggests that we're incorrectly blocking events under some circumstances. Could you confirm that you're not blocking the event anywhere? |
I'm not blocking any events anywhere in my code. However, I am using an event number that doesn't correspond to an actual pygame event type. I'm using 234. I guess it's possible that pygame_cffi's default is to only allow "real" event numbers. |
It turns out that, unlike pygame_cffi, pygame doesn't use event.post to add the event to the SDL stack in this case. Consequently, a lot of the checking on the event type is skipped, which is why this works in pygame. While I'd prefer not to have this quirk, if people are relying on pygame's behaviour here, we should probably adjust our implementation to match. |
Fixed by #36 |
My game uses
pygame.mixer.music.set_endevent()
to register an event type to be used when music playback is complete. Running my game withpygame_cffi
and PyPy, the following traceback was logged when the queued music file finished playing, and the registered event was never observed. I don't get this traceback with standardpygame
in cPython.The text was updated successfully, but these errors were encountered: