| Summary: | Mix_Init always returns 0 - no supported music interfaces found | ||
|---|---|---|---|
| Product: | SDL_mixer | Reporter: | Steffen Pankratz <kratz00> |
| Component: | misc | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | blocker | ||
| Priority: | P2 | CC: | akari, martin |
| Version: | 2.0.2 | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
| Attachments: | Patch for has_music function | ||
Hey! I had the exact same problem, and the exact same idea. Replacing 'opened' with 'loaded' in 'has_music' won't work though, as the 'opened' check is intentional later, in 'open_music', to see if the ogg music did actually open. What needs to be changed is the way the error flag in Mix_Init gets generated ... @devs this should be a simple fix and I'd do it myself if I had the commit rights. Hope it gets fixed soon :) This problem, however, only concerns the return flag of Mix_Init, it does not break any functionality. Just ignoring the return flag (which is still not good, however) is an acceptable workaround until this gets fixed. This should be fixed in this commit, can you verify? https://hg.libsdl.org/SDL_mixer/rev/7fa15b556953 Seems like it :) Didn't test extensively, but the return code of Mix_Init seems correct. Greetings and thanks, Martin Great, thanks! |
Created attachment 3049 [details] Patch for has_music function Previously working code broke after the upgrade to version 2.0.2. The call 'Mix_Init(MIX_INIT_OGG)' always returned 0. I made sure that SDL_mixer was built with support for Ogg Vorbis. After I little bit of debugging, it looks to me like the implementation in the 'has_music' function might be wrong. 'Mix_Init' calls 'load_music' which sets 'loaded' to 'SDL_TRUE' for all supported music interfaces. 'Mix_Init' then calls 'has_music' for the requested music interface. 'has_music' checks that the requested music interface was 'opened'. Which is not that case at that time, so I think 'opened' should be replace by 'loaded'. For me the attached patch fixed the problem.