Closed xtsm closed 1 month ago
@Romans-I-XVI could you please check if the problem you reported earlier (https://github.com/FNA-XNA/FAudio/pull/337#issuecomment-2049854555) persists in this branch?
@Romans-I-XVI could you please check if the problem you reported earlier (#337 (comment)) persists in this branch?
Just tested it out, this fixes the issue I was experiencing.
Sounds good - we're pretty close to the tag date so I'll merge this in right after 24.05 is out!
@flibitijibibo no tag yet? i thought FNA 24.05 already got released
Fell behind due to SDL_GPU and some other things, will do a full review later today to be extra sure that this is solid.
Second attempt. Previous here: https://github.com/FNA-XNA/FAudio/pull/337
Now that we release buffer lock before executing callbacks, some code from another thread can get scheduled between mutex unlock and callback call and observe empty buffer queue right before callback puts a new buffer there. XNA_Song determines the end of the song by simply checking if the queue is empty, which may lead to random playback breaks.
Not sure how to properly check for the song end but the buffer decoding function also zeroes out total samples counter when it finishes a EOS-flagged buffer so checking if that counter is zero should cut it... probably?