mkxp-z / mkxp-z

Open-source cross-platform player for (some) RPG Maker XP / VX / VX Ace games. A very heavily modified fork of mkxp. RGSS on steroids with a stupid name.
https://github.com/mkxp-z/mkxp-z/wiki
GNU General Public License v2.0
140 stars 39 forks source link

Check for audioThreadTermReq in movie audio thread #152

Open Eblo opened 5 months ago

Eblo commented 5 months ago

If you try to terminate the program or use the skip function during playback of a movie with audio, it would hang with endless errors messages similar to the following:

[ALSOFT] (WW) Error generated on context 000001ec9422ee60, code 0xa001, "Invalid source ID 10"

This happens because the audio thread is stuck in a while loop and trying to read from an OpenAL source that no longer exists. This PR fixes that.

Eblo commented 5 months ago

To test this, you'll want to set skippable to true just to ensure you cover both cases. You'll need a theora video that has audio. Make the following call somewhere in a project:

Graphics.play_movie('Movies/some_video_with_audio.ogv', 100, true)

Test both quitting the entire program, and skipping the playback. Without the fix, the application will hang and repeat some error similar to what's in the original post here. With the fix, it should close the program or skip the movie depending on what you did.