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 4056 - MP3 playback via SMPEG doesn't compile; crashes
Summary: MP3 playback via SMPEG doesn't compile; crashes
Status: RESOLVED ABANDONED
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: 2.0.2
Hardware: All All
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-20 11:41 UTC by Ralph Versteegen
Modified: 2019-02-02 16:55 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Versteegen 2018-01-20 11:41:04 UTC
The smpeg interface (--enable-music-mp3 --enable-music-mp3-smpeg) no longer compiles, since the recent refactoring. Here's a fix for that:

--- a/music_smpeg.c     Tue Dec 12 22:32:02 2017 -0800
+++ b/music_smpeg.c     Sat Jan 20 18:28:23 2018 +1300
@@ -138,7 +138,7 @@
         SDL_free(music);
         return NULL;
     }
-    smpeg.SMPEG_actualSpec(mp3, &music_spec);
+    smpeg.SMPEG_actualSpec(music->mp3, &music_spec);
 
     music->freesrc = freesrc;
     return music;
@@ -172,7 +172,7 @@
     Uint8 *stream = (Uint8 *)data;
     int len = bytes;
     int left = (len - smpeg.SMPEG_playAudio(music->mp3, stream, len));
-    if (left > 0) {
+    if (left > 0)
         stream += (len - left);
     return left;
 }

However, with this patch applied it compiles but immediately crashes when attempting to play any mp3 file (tested only on 32 bit Windows).

Also, note the suspicious lines above
     if (left > 0) {
         stream += (len - left);
which were added in r798 but do nothing.

Even wit
Comment 1 Vitaly Novichkov 2019-02-01 15:38:06 UTC
I think, it's no more actual since SMPEG support has been completely removed recently. So, SDL Mixer now supports libMAD and MPG123 libraries only for MP3 playback.
Comment 2 Ozkan Sezer 2019-02-02 16:55:18 UTC
Build was fixed by https://hg.libsdl.org/SDL_mixer/rev/b56dbe75cac8
then the smpeg support was removed completely. Closing as abandoned.