Skip to content
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

Corrections after 1.8.1 release #474

Merged
merged 16 commits into from
Dec 26, 2024
Next Next commit
Fix potential crash during game over animation when video background …
…is enabled
Reco1I committed Dec 17, 2024
commit 7832e294f9e1b8f464be34481d939543bc7872ca
10 changes: 7 additions & 3 deletions src/ru/nsu/ccfit/zuev/osu/game/GameScene.java
Original file line number Diff line number Diff line change
@@ -2340,9 +2340,13 @@ public void onUpdate(float pSecondsElapsed) {
scene.setTimeMultiplier(decreasedSpeed);

if (video != null) {
// Aparently MediaPlayer API doesn't support setting playback speed
// below 0.01 causing an IllegalStateException.
video.setPlaybackSpeed(Math.max(0.01f, decreasedSpeed));
// In some devices this can throw an exception, unfortunately there's no
// documentation that explains how to avoid that scenario. Thanks Google.
try {
video.setPlaybackSpeed(decreasedSpeed);
} catch (Exception e) {
Log.e("GameScene", "Failed to change video playback speed during game over animation.", e);
}
}

songService.setFrequencyForcefully(decreasedFrequency);