ppy / osu-framework

A game framework written with osu! in mind.
MIT License
1.61k stars 399 forks source link

Sample loading code does not check errors properly #4078

Open bdach opened 3 years ago

bdach commented 3 years ago

Noticed during review of https://github.com/ppy/osu/pull/10925. Can be reproduced game-side with this skin:

IAmUseless (Android 4+ (modified)) (IAmUseless29).zip

Spinner samples in this skin will fail to play and stay in a weird state (having Playing == false but Looping == true) The core of the problem is here:

https://github.com/ppy/osu-framework/blob/ca72e336a2deb77d1e4523544b8953291cd4385f/osu.Framework/Audio/Sample/SampleBass.cs#L60-L76

Several issues with this code:

This is probably a bigger issue all over as we don't generally check Bass.LastError all that much.

peppy commented 3 years ago

Seems like this should get some priority, so adding to this month's milestone.