[Ohrrpgce] [ohrrpgce/ohrrpgce] Mac/Linux, music_sdl/sdl2: Module loop points ignored; pause when looping (#1187)

Ralph Versteegen notifications at github.com
Sun Jan 3 23:25:47 PST 2021


SDL_mixer and SDL2_mixer support two different libraries for playing modules: libmikmod and libmodplug. libmodplug is far better in general. SDL_mixer defaults to mikmod, SDL2_mixer to modplug. Our SDL_mixer.dll is compiled to use modplug. Our x86 SDL_mixer.framework for Mac isn't.

In SDL_mixer, looping is disabled for both mikmod and modplug.
In SDL2_mixer, looping is disabled for modplug but enabled for mikmod (it was enabled in SDL_mixer r826 "Fixed bug 1558 - mikmod broken volume and loop support")
I have enabled it for both mikmod and modplug in my SDL/SDL2_mixer.dll builds.

This means that loop points are ignored, and instead of letting mikmod/modplug do looping, SDL_mixer does it itself, which also results in a subtle pause on loop when using modplug, but I didn't notice with when using mikmod in one test file.

On Mac (except x86+gfx_sdl) and Linux we use default/system builds of these libraries so we're stuck with broken looping.
I am guilty of never sending a patch to SDL_mixer to fix looping. However it's been filed as [a bug against SDL_mixer](https://bugzilla.libsdl.org/show_bug.cgi?id=1499) forever, don't know why they didn't fix it. Amusingly SDL Mixer X actually advertises that it enabled loop points in modplug.

I'm adding a couple testcases from Ravancloak to svn.

If libmodplug is a separate dynamic library then we could use dlopen/dlsym to get `ModPlug_SetSettings` and just change the loop setting, which is a global setting that SDL_mixer apparently only sets when it initialises modplug, which I think happens the first time you play a module file.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/ohrrpgce/ohrrpgce/issues/1187
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20210103/eeb044d4/attachment.html>


More information about the Ohrrpgce mailing list