| Summary: | Mix_FadeOutChannel never sets fade_volume_reset causing faded out chunks to have volume reset incorrectly | ||
|---|---|---|---|
| Product: | SDL_mixer | Reporter: | birk.kevin |
| Component: | misc | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | shadowm, sylvain.becker |
| Version: | 2.0.4 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
Thanks ! It's here: https://hg.libsdl.org/SDL_mixer/rev/c8ae0feb801e I also modified the Mix_FadeInChannel because when playing on the same channel while fading, it was saving the fading volume. Please give a try ! |
The following code at line 1155 in mixer.c ensures that the conditional to set fade_volume_reset can never be true. mix_channel[which].fade_volume = mix_channel[which].volume; mix_channel[which].fading = MIX_FADING_OUT; mix_channel[which].fade_length = (Uint32)ms; mix_channel[which].ticks_fade = SDL_GetTicks(); /* only change fade_volume_reset if we're not fading. */ if (mix_channel[which].fading == MIX_NO_FADING) { mix_channel[which].fade_volume_reset = mix_channel[which].volume; } The `mix_channel[which].fading = MIX_FADING_OUT;` must be moved after the `if` statement.