We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3833

Summary: [PATCH] No (silent) MP3 playback using included smpeg2 library
Product: SDL_mixer Reporter: Holger Schemel <sdl-bugzilla>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.1   
Hardware: x86_64   
OS: Linux   
Attachments: patch

Description Holger Schemel 2017-09-18 18:27:21 UTC
Created attachment 2949 [details]
patch

Summary: When playing MP3 files using the included smpeg2 library, audio output is silent.

How to reproduce the problem: Build latest SDL2_mixer and smpeg2 (from directory "external/smpeg2-2.0.0") and play MP3 file using included music player "playmus". (Tested on Ubuntu 12.04 and Mac OS X 10.11.)

Expected behaviour: "playmus" plays MP3 music through the computer's audio device.

Observed behaviour: "playmus" appears to be playing, but the computer's audio device remains silent.

The problem was introduced with changeset 718:fb0562cc1559, which replaces legacy functions like SDL_OpenAudio(), SDL_LockAudio(), SDL_PauseAudio(), SDL_MixAudio() etc. with their non-legacy counterparts like SDL_OpenAudioDevice(), SDL_LockAudioDevice(), SDL_PauseAudioDevice() and SDL_MixAudioFormat() in the SDL2_mixer code, while the smpeg2 code still uses the legacy functions.

Replacing SDL_MixAudio() with SDL_MixAudioFormat() in the smpeg2 code fixes the problem, and MP3 playback using SDL2_mixer with smpeg2 works fine again (from both "playmus" and from my SDL2/SDL2_mixer/smpeg2 based games).

The attached patch fixes the problem.
Comment 1 Sam Lantinga 2017-09-18 23:06:03 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL_mixer/rev/f04d39d0b63c