| Summary: | [PATCH] native_midi_macosx: volume should be set before starting playing | ||
|---|---|---|---|
| Product: | SDL_mixer | Reporter: | michaeljosephmaltese |
| Component: | misc | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sezeroz |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Mac OS X (All) | ||
| Attachments: | native_midi_macosx: set volume before starting playing | ||
This patch is in: https://hg.libsdl.org/SDL_mixer/rev/900ad643ac68 Thanks. |
Created attachment 4525 [details] native_midi_macosx: set volume before starting playing On macOS, the native MIDI backend applies volume after the MIDI file starts playing, which can lead to a split second of music at an incorrect volume (e.g. say you want to fade it in, or just have it start muted). I tracked this to native_midi_start in native_midi_macosx.c, which calls MusicPlayerStart before calling GetSequenceAudioUnit and native_midi_setvolume — this needs to be the other way round. We can safely move these around since we have a valid AudioUnit in the graph after calling MusicPlayerPreroll. Patch attached.