| Summary: | libmad MP3 sample support broken | ||
|---|---|---|---|
| Product: | SDL_mixer | Reporter: | prefer.irc |
| Component: | misc | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED DUPLICATE | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | fran |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Attachments: |
Implement suggested fix
Fix libmad MP3 sample support, part 2 (bug#2399 for details) Fix libmad MP3 sample support, part 3 (bug#2399 for details) |
||
Created attachment 1559 [details]
Implement suggested fix
Created attachment 1560 [details] Fix libmad MP3 sample support, part 2 (bug#2399 for details) Mix_LoadMP3_RW was only declared for smpeg2 (MP3_MUSIC), however it should also be declared for libmad (MP3_MAD_MUSIC). Created attachment 1561 [details] Fix libmad MP3 sample support, part 3 (bug#2399 for details) Configure option --enable-music-mp3-mad-gpl should include load_mp3.c in $SOURCES I can confirm linking issues when trying ./configure --enable-mp3-music-mad-gpl
Building fails when linking playwave:
build/.libs/libSDL2_mixer.so: undefined reference to `Mix_LoadMP3_RW'
Your patch fixes it for me.
|
Source: HG tip (670/e7c3e537322d) Disclaimer: Unconfirmed. Found while browsing source (attempting to determine build/link/run time dependencies) Description: load_mp3.c::Mix_LoadMP3_RW calls Mix_Init(MIX_INIT_MP3) and checks the result for the MIX_INIT_MP3 flag, but that flag is not set by mixer.c::Mix_Init if MP3_MUSIC (smpeg2) is disabled. To use libmad, smpeg2 has to be disabled because smpeg2 takes precedence over libmad. Fix: in mixer.c::Mix_Init (flags & MIX_INIT_MP3) {...} block, use following code: if (flags & MIX_INIT_MP3) { #ifdef MP3_MUSIC if ((initialized & MIX_INIT_MP3) || Mix_InitMP3() == 0) { result |= MIX_INIT_MP3; } #elif MP3_MAD_MUSIC result |= MIX_INIT_MP3; #else Mix_SetError("Mixer not built with MP3 support"); #endif