From 64b2ef747e954b1aa2abe250ebe903ebd154e5ec Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 14 Jan 2024 11:44:40 -0800
Subject: [PATCH] Revert "Use dr_mp3 instead of minimp3 for default MP3
support"
This reverts commit c94f6cec7269fb2d37b83791130a7f8f8109357d.
minimp3 supports LAME tags for more precise seeking and length information
Fixes https://github.com/libsdl-org/SDL_mixer/issues/439
(cherry picked from commit c3e80e731336e605e434dda5743a25ff371961a8)
---
Android.mk | 8 +-
CMakeLists.txt | 20 +-
README.txt | 2 +-
VisualC-WinRT/SDL_mixer-UWP.vcxproj | 16 +-
VisualC-WinRT/SDL_mixer-UWP.vcxproj.filters | 12 +-
VisualC/SDL_mixer.vcxproj | 12 +-
VisualC/SDL_mixer.vcxproj.filters | 12 +-
Xcode/SDL_mixer.xcodeproj/project.pbxproj | 20 +-
external/SDL | 2 +-
src/codecs/dr_libs/dr_mp3.h | 4834 -----------------
src/codecs/minimp3/LICENSE | 117 +
src/codecs/minimp3/README.md | 310 ++
src/codecs/minimp3/minimp3.h | 1865 +++++++
src/codecs/minimp3/minimp3_ex.h | 1397 +++++
src/codecs/music_drmp3.c | 296 -
src/codecs/music_minimp3.c | 289 +
src/codecs/{music_drmp3.h => music_minimp3.h} | 4 +-
src/music.c | 6 +-
src/music.h | 2 +-
19 files changed, 4036 insertions(+), 5188 deletions(-)
delete mode 100644 src/codecs/dr_libs/dr_mp3.h
create mode 100644 src/codecs/minimp3/LICENSE
create mode 100644 src/codecs/minimp3/README.md
create mode 100644 src/codecs/minimp3/minimp3.h
create mode 100644 src/codecs/minimp3/minimp3_ex.h
delete mode 100644 src/codecs/music_drmp3.c
create mode 100644 src/codecs/music_minimp3.c
rename src/codecs/{music_drmp3.h => music_minimp3.h} (90%)
diff --git a/Android.mk b/Android.mk
index b21215b3..d02a218f 100644
--- a/Android.mk
+++ b/Android.mk
@@ -19,8 +19,8 @@ SUPPORT_OGG ?= false
OGG_LIBRARY_PATH := external/ogg
VORBIS_LIBRARY_PATH := external/tremor
-# Enable this if you want to support loading MP3 music via dr_mp3
-SUPPORT_MP3_DRMP3 ?= true
+# Enable this if you want to support loading MP3 music via MINIMP3
+SUPPORT_MP3_MINIMP3 ?= true
# Enable this if you want to support loading MP3 music via MPG123
SUPPORT_MP3_MPG123 ?= false
@@ -120,8 +120,8 @@ ifeq ($(SUPPORT_OGG),true)
LOCAL_STATIC_LIBRARIES += ogg vorbisidec
endif
-ifeq ($(SUPPORT_MP3_DRMP3),true)
- LOCAL_CFLAGS += -DMUSIC_MP3_DRMP3
+ifeq ($(SUPPORT_MP3_MINIMP3),true)
+ LOCAL_CFLAGS += -DMUSIC_MP3_MINIMP3
endif
# This needs to be a shared library to comply with the LGPL license
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cbef536a..defddaf1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -139,13 +139,13 @@ endif()
option(SDL3MIXER_MP3 "Enable MP3 music" ON)
-cmake_dependent_option(SDL3MIXER_MP3_DRMP3 "Support loading MP3 music via dr_mp3" ON SDL3MIXER_MP3 OFF)
+cmake_dependent_option(SDL3MIXER_MP3_MINIMP3 "Support loading MP3 music via minimp3" ON SDL3MIXER_MP3 OFF)
cmake_dependent_option(SDL3MIXER_MP3_MPG123 "Support loading MP3 music via MPG123" OFF SDL3MIXER_MP3 OFF)
cmake_dependent_option(SDL3MIXER_MP3_MPG123_SHARED "Dynamically load mpg123" "${SDL3MIXER_DEPS_SHARED}" SDL3MIXER_MP3_MPG123 OFF)
-if(SDL3MIXER_MP3 AND NOT (SDL3MIXER_MP3_DRMP3 OR SDL3MIXER_MP3_MPG123))
- message(FATAL_ERROR "MP3 support was enabled (SDL3MIXER_MP3) but neither drmp3 (SDL3MIXER_MP3_DRMP3) or mpg123 (SDL3MIXER_MP3_MPG123) were enabled.")
+if(SDL3MIXER_MP3 AND NOT (SDL3MIXER_MP3_MINIMP3 OR SDL3MIXER_MP3_MPG123))
+ message(FATAL_ERROR "MP3 support was enabled (SDL3MIXER_MP3) but neither minimp3 (SDL3MIXER_MP3_MINIMP3) or mpg123 (SDL3MIXER_MP3_MPG123) were enabled.")
endif()
option(SDL3MIXER_MIDI "Enable MIDI music" ON)
@@ -240,10 +240,10 @@ add_library(${sdl3_mixer_target_name}
src/codecs/mp3utils.c
src/codecs/music_cmd.c
src/codecs/music_drflac.c
- src/codecs/music_drmp3.c
src/codecs/music_flac.c
src/codecs/music_fluidsynth.c
src/codecs/music_gme.c
+ src/codecs/music_minimp3.c
src/codecs/music_modplug.c
src/codecs/music_mpg123.c
src/codecs/music_nativemidi.c
@@ -873,11 +873,11 @@ if(SDL3MIXER_MOD_MODPLUG_ENABLED OR SDL3MIXER_MOD_XMP_ENABLED OR SDL3MIXER_MOD_X
set(SDL3MIXER_MOD_ENABLED TRUE)
endif()
-list(APPEND SDL3MIXER_BACKENDS MP3_DRMP3)
-set(SDL3MIXER_MP3_DRMP3_ENABLED FALSE)
-if(SDL3MIXER_MP3_DRMP3)
- set(SDL3MIXER_MP3_DRMP3_ENABLED TRUE)
- target_compile_definitions(${sdl3_mixer_target_name} PRIVATE MUSIC_MP3_DRMP3)
+list(APPEND SDL3MIXER_BACKENDS MP3_MINIMP3)
+set(SDL3MIXER_MP3_MINIMP3_ENABLED FALSE)
+if(SDL3MIXER_MP3_MINIMP3)
+ set(SDL3MIXER_MP3_MINIMP3_ENABLED TRUE)
+ target_compile_definitions(${sdl3_mixer_target_name} PRIVATE MUSIC_MP3_MINIMP3)
endif()
list(APPEND SDL3MIXER_BACKENDS MP3_MPG123)
@@ -933,7 +933,7 @@ if(SDL3MIXER_MP3_MPG123)
endif()
set(SDL3MIXER_MP3_ENABLED FALSE)
-if(SDL3MIXER_MP3_DRMP3_ENABLED OR SDL3MIXER_MP3_MPG123_ENABLED)
+if(SDL3MIXER_MP3_MINIMP3_ENABLED OR SDL3MIXER_MP3_MPG123_ENABLED)
set(SDL3MIXER_MP3_ENABLED TRUE)
endif()
diff --git a/README.txt b/README.txt
index de11755b..6bfc553c 100644
--- a/README.txt
+++ b/README.txt
@@ -28,4 +28,4 @@ Support for software MIDI, MOD, and Opus are not included by default because of
- When building with Xcode, you can edit the config at the top of the project to enable them, and you will need to include the appropriate framework in your application.
- For Android, you can edit the config at the top of Android.mk to enable them.
-The default MP3 support is provided using dr_mp3. SDL_mixer also supports using libmpg123: you can enable it by passing --enable-music-mp3-mpg123 to configure.
+The default MP3 support is provided using minimp3. SDL_mixer also supports using libmpg123: you can enable it by passing --enable-music-mp3-mpg123 to configure.
diff --git a/VisualC-WinRT/SDL_mixer-UWP.vcxproj b/VisualC-WinRT/SDL_mixer-UWP.vcxproj
index 1be6429a..5139b0ec 100644
--- a/VisualC-WinRT/SDL_mixer-UWP.vcxproj
+++ b/VisualC-WinRT/SDL_mixer-UWP.vcxproj
@@ -39,10 +39,10 @@
<ClCompile Include="..\src\codecs\mp3utils.c" />
<ClCompile Include="..\src\codecs\music_cmd.c" />
<ClCompile Include="..\src\codecs\music_drflac.c" />
- <ClCompile Include="..\src\codecs\music_drmp3.c" />
<ClCompile Include="..\src\codecs\music_flac.c" />
<ClCompile Include="..\src\codecs\music_fluidsynth.c" />
<ClCompile Include="..\src\codecs\music_gme.c" />
+ <ClCompile Include="..\src\codecs\music_minimp3.c" />
<ClCompile Include="..\src\codecs\music_modplug.c" />
<ClCompile Include="..\src\codecs\music_mpg123.c" />
<ClCompile Include="..\src\codecs\music_nativemidi.c" />
@@ -71,10 +71,10 @@
<ClInclude Include="..\src\codecs\mp3utils.h" />
<ClInclude Include="..\src\codecs\music_cmd.h" />
<ClInclude Include="..\src\codecs\music_drflac.h" />
- <ClInclude Include="..\src\codecs\music_drmp3.h" />
<ClInclude Include="..\src\codecs\music_flac.h" />
<ClInclude Include="..\src\codecs\music_fluidsynth.h" />
<ClInclude Include="..\src\codecs\music_gme.h" />
+ <ClInclude Include="..\src\codecs\music_minimp3.h" />
<ClInclude Include="..\src\codecs\music_modplug.h" />
<ClInclude Include="..\src\codecs\music_mpg123.h" />
<ClInclude Include="..\src\codecs\music_nativemidi.h" />
@@ -204,7 +204,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;..\src;..\src\codecs;..\src\codecs\timidity;..\external\ogg\include;..\external\vorbis\include;..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_DRMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_MINIMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -217,7 +217,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;..\src;..\src\codecs;..\src\codecs\timidity;..\external\ogg\include;..\external\vorbis\include;..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_DRMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_MINIMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -230,7 +230,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;..\src;..\src\codecs;..\src\codecs\timidity;..\external\ogg\include;..\external\vorbis\include;..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_DRMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_MINIMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -243,7 +243,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;..\src;..\src\codecs;..\src\codecs\timidity;..\external\ogg\include;..\external\vorbis\include;..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_DRMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_MINIMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -256,7 +256,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;..\src;..\src\codecs;..\src\codecs\timidity;..\external\ogg\include;..\external\vorbis\include;..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_DRMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_MINIMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -269,7 +269,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;..\src;..\src\codecs;..\src\codecs\timidity;..\external\ogg\include;..\external\vorbis\include;..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_DRMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_MINIMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
diff --git a/VisualC-WinRT/SDL_mixer-UWP.vcxproj.filters b/VisualC-WinRT/SDL_mixer-UWP.vcxproj.filters
index aedb7e0e..916e423e 100644
--- a/VisualC-WinRT/SDL_mixer-UWP.vcxproj.filters
+++ b/VisualC-WinRT/SDL_mixer-UWP.vcxproj.filters
@@ -64,9 +64,6 @@
<ClCompile Include="..\src\codecs\music_drflac.c">
<Filter>Sources</Filter>
</ClCompile>
- <ClCompile Include="..\src\codecs\music_drmp3.c">
- <Filter>Sources</Filter>
- </ClCompile>
<ClCompile Include="..\src\codecs\music_flac.c">
<Filter>Sources</Filter>
</ClCompile>
@@ -76,6 +73,9 @@
<ClCompile Include="..\src\codecs\music_gme.c">
<Filter>Sources</Filter>
</ClCompile>
+ <ClCompile Include="..\src\codecs\music_minimp3.c">
+ <Filter>Sources</Filter>
+ </ClCompile>
<ClCompile Include="..\src\codecs\music_modplug.c">
<Filter>Sources</Filter>
</ClCompile>
@@ -162,9 +162,6 @@
<ClInclude Include="..\src\codecs\music_drflac.h">
<Filter>Sources</Filter>
</ClInclude>
- <ClInclude Include="..\src\codecs\music_drmp3.h">
- <Filter>Sources</Filter>
- </ClInclude>
<ClInclude Include="..\src\codecs\music_flac.h">
<Filter>Sources</Filter>
</ClInclude>
@@ -174,6 +171,9 @@
<ClInclude Include="..\src\codecs\music_gme.h">
<Filter>Sources</Filter>
</ClInclude>
+ <ClInclude Include="..\src\codecs\music_minimp3.h">
+ <Filter>Sources</Filter>
+ </ClInclude>
<ClInclude Include="..\src\codecs\music_modplug.h">
<Filter>Sources</Filter>
</ClInclude>
diff --git a/VisualC/SDL_mixer.vcxproj b/VisualC/SDL_mixer.vcxproj
index b49e4f46..29a9ce6f 100644
--- a/VisualC/SDL_mixer.vcxproj
+++ b/VisualC/SDL_mixer.vcxproj
@@ -114,7 +114,7 @@
<AdditionalOptions>/D OGG_DYNAMIC=\"libvorbisfile-3.dll\" %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\include;..\src;..\src\codecs;..\src\codecs\timidity;..\src\codecs\native_midi;external\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>DLL_EXPORT;_DEBUG;WIN32;_WINDOWS;MUSIC_WAV;MUSIC_WAVPACK;MUSIC_FLAC_DRFLAC;MUSIC_MOD_XMP;XMP_DYNAMIC="libxmp.dll";MUSIC_MP3_DRMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_OPUS;OPUS_DYNAMIC="libopusfile-0.dll";WAVPACK_DYNAMIC="libwavpack-1.dll";MUSIC_MID_TIMIDITY;MUSIC_MID_NATIVE</PreprocessorDefinitions>
+ <PreprocessorDefinitions>DLL_EXPORT;_DEBUG;WIN32;_WINDOWS;MUSIC_WAV;MUSIC_WAVPACK;MUSIC_FLAC_DRFLAC;MUSIC_MOD_XMP;XMP_DYNAMIC="libxmp.dll";MUSIC_MP3_MINIMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_OPUS;OPUS_DYNAMIC="libopusfile-0.dll";WAVPACK_DYNAMIC="libwavpack-1.dll";MUSIC_MID_TIMIDITY;MUSIC_MID_NATIVE</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
@@ -144,7 +144,7 @@
<AdditionalOptions>/D OGG_DYNAMIC=\"libvorbisfile-3.dll\" %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\include;..\src;..\src\codecs;..\src\codecs\timidity;..\src\codecs\native_midi;external\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>DLL_EXPORT;_DEBUG;WIN32;_WINDOWS;MUSIC_WAV;MUSIC_WAVPACK;MUSIC_FLAC_DRFLAC;MUSIC_MOD_XMP;XMP_DYNAMIC="libxmp.dll";MUSIC_MP3_DRMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_OPUS;OPUS_DYNAMIC="libopusfile-0.dll";WAVPACK_DYNAMIC="libwavpack-1.dll";MUSIC_MID_TIMIDITY;MUSIC_MID_NATIVE</PreprocessorDefinitions>
+ <PreprocessorDefinitions>DLL_EXPORT;_DEBUG;WIN32;_WINDOWS;MUSIC_WAV;MUSIC_WAVPACK;MUSIC_FLAC_DRFLAC;MUSIC_MOD_XMP;XMP_DYNAMIC="libxmp.dll";MUSIC_MP3_MINIMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_OPUS;OPUS_DYNAMIC="libopusfile-0.dll";WAVPACK_DYNAMIC="libwavpack-1.dll";MUSIC_MID_TIMIDITY;MUSIC_MID_NATIVE</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
@@ -173,7 +173,7 @@
<ClCompile>
<AdditionalOptions>/D OGG_DYNAMIC=\"libvorbisfile-3.dll\" %(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>..\include;..\src;..\src\codecs;..\src\codecs\timidity;..\src\codecs\native_midi;external\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>DLL_EXPORT;NDEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;MUSIC_WAVPACK;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MOD_XMP;XMP_DYNAMIC="libxmp.dll";MUSIC_MP3_DRMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_OPUS;OPUS_DYNAMIC="libopusfile-0.dll";WAVPACK_DYNAMIC="libwavpack-1.dll";MUSIC_MID_TIMIDITY;MUSIC_MID_NATIVE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>DLL_EXPORT;NDEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;MUSIC_WAVPACK;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MOD_XMP;XMP_DYNAMIC="libxmp.dll";MUSIC_MP3_MINIMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_OPUS;OPUS_DYNAMIC="libopusfile-0.dll";WAVPACK_DYNAMIC="libwavpack-1.dll";MUSIC_MID_TIMIDITY;MUSIC_MID_NATIVE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
@@ -200,7 +200,7 @@
<ClCompile>
<AdditionalOptions>/D OGG_DYNAMIC=\"libvorbisfile-3.dll\" %(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>..\include;..\src;..\src\codecs;..\src\codecs\timidity;..\src\codecs\native_midi;external\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>DLL_EXPORT;NDEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;MUSIC_WAVPACK;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MOD_XMP;XMP_DYNAMIC="libxmp.dll";MUSIC_MP3_DRMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_OPUS;OPUS_DYNAMIC="libopusfile-0.dll";WAVPACK_DYNAMIC="libwavpack-1.dll";MUSIC_MID_TIMIDITY;MUSIC_MID_NATIVE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>DLL_EXPORT;NDEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;MUSIC_WAVPACK;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MOD_XMP;XMP_DYNAMIC="libxmp.dll";MUSIC_MP3_MINIMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_OPUS;OPUS_DYNAMIC="libopusfile-0.dll";WAVPACK_DYNAMIC="libwavpack-1.dll";MUSIC_MID_TIMIDITY;MUSIC_MID_NATIVE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
@@ -226,10 +226,10 @@
<ClInclude Include="..\src\codecs\mp3utils.h" />
<ClInclude Include="..\src\codecs\music_cmd.h" />
<ClInclude Include="..\src\codecs\music_drflac.h" />
- <ClInclude Include="..\src\codecs\music_drmp3.h" />
<ClInclude Include="..\src\codecs\music_flac.h" />
<ClInclude Include="..\src\codecs\music_fluidsynth.h" />
<ClInclude Include="..\src\codecs\music_gme.h" />
+ <ClInclude Include="..\src\codecs\music_minimp3.h" />
<ClInclude Include="..\src\codecs\music_modplug.h" />
<ClInclude Include="..\src\codecs\music_mpg123.h" />
<ClInclude Include="..\src\codecs\music_nativemidi.h" />
@@ -451,10 +451,10 @@
<ClCompile Include="..\src\codecs\mp3utils.c" />
<ClCompile Include="..\src\codecs\music_cmd.c" />
<ClCompile Include="..\src\codecs\music_drflac.c" />
- <ClCompile Include="..\src\codecs\music_drmp3.c" />
<ClCompile Include="..\src\codecs\music_flac.c" />
<ClCompile Include="..\src\codecs\music_fluidsynth.c" />
<ClCompile Include="..\src\codecs\music_gme.c" />
+ <ClCompile Include="..\src\codecs\music_minimp3.c" />
<ClCompile Include="..\src\codecs\music_modplug.c" />
<ClCompile Include="..\src\codecs\music_mpg123.c" />
<ClCompile Include="..\src\codecs\music_nativemidi.c" />
diff --git a/VisualC/SDL_mixer.vcxproj.filters b/VisualC/SDL_mixer.vcxproj.filters
index 6ee11443..7b840997 100644
--- a/VisualC/SDL_mixer.vcxproj.filters
+++ b/VisualC/SDL_mixer.vcxproj.filters
@@ -34,9 +34,6 @@
<ClInclude Include="..\src\codecs\music_drflac.h">
<Filter>Sources</Filter>
</ClInclude>
- <ClInclude Include="..\src\codecs\music_drmp3.h">
- <Filter>Sources</Filter>
- </ClInclude>
<ClInclude Include="..\src\codecs\music_flac.h">
<Filter>Sources</Filter>
</ClInclude>
@@ -46,6 +43,9 @@
<ClInclude Include="..\src\codecs\music_gme.h">
<Filter>Sources</Filter>
</ClInclude>
+ <ClInclude Include="..\src\codecs\music_minimp3.h">
+ <Filter>Sources</Filter>
+ </ClInclude>
<ClInclude Include="..\src\codecs\music_modplug.h">
<Filter>Sources</Filter>
</ClInclude>
@@ -182,9 +182,6 @@
<ClCompile Include="..\src\codecs\music_drflac.c">
<Filter>Sources</Filter>
</ClCompile>
- <ClCompile Include="..\src\codecs\music_drmp3.c">
- <Filter>Sources</Filter>
- </ClCompile>
<ClCompile Include="..\src\codecs\music_flac.c">
<Filter>Sources</Filter>
</ClCompile>
@@ -194,6 +191,9 @@
<ClCompile Include="..\src\codecs\music_gme.c">
<Filter>Sources</Filter>
</ClCompile>
+ <ClCompile Include="..\src\codecs\music_minimp3.c">
+ <Filter>Sources</Filter>
+ </ClCompile>
<ClCompile Include="..\src\codecs\music_modplug.c">
<Filter>Sources</Filter>
</ClCompile>
diff --git a/Xcode/SDL_mixer.xcodeproj/project.pbxproj b/Xcode/SDL_mixer.xcodeproj/project.pbxproj
index d333f391..b4345ccf 100644
--- a/Xcode/SDL_mixer.xcodeproj/project.pbxproj
+++ b/Xcode/SDL_mixer.xcodeproj/project.pbxproj
@@ -76,9 +76,9 @@
BE1FA8CD07AF96B2004B6283 /* SDL_mixer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1014BAEA010A4B677F000001 /* SDL_mixer.h */; settings = {ATTRIBUTES = (Public, ); }; };
F30240632881DF95002F32D6 /* music_xmp.h in Headers */ = {isa = PBXBuildFile; fileRef = F302405F2881DF94002F32D6 /* music_xmp.h */; };
F30240652881DF95002F32D6 /* music_xmp.c in Sources */ = {isa = PBXBuildFile; fileRef = F30240622881DF95002F32D6 /* music_xmp.c */; };
+ F307A52F2B5473760012534B /* music_minimp3.c in Sources */ = {isa = PBXBuildFile; fileRef = F307A52D2B5473760012534B /* music_minimp3.c */; };
+ F307A5302B5473760012534B /* music_minimp3.h in Headers */ = {isa = PBXBuildFile; fileRef = F307A52E2B5473760012534B /* music_minimp3.h */; };
F3249B39285C448100DB9B5C /* CMake in Resources */ = {isa = PBXBuildFile; fileRef = F3249B36285C448100DB9B5C /* CMake */; };
- F37A8D2D2838924900C38E95 /* music_drmp3.h in Headers */ = {isa = PBXBuildFile; fileRef = F37A8D2B2838924900C38E95 /* music_drmp3.h */; };
- F37A8D2F2838924900C38E95 /* music_drmp3.c in Sources */ = {isa = PBXBuildFile; fileRef = F37A8D2C2838924900C38E95 /* music_drmp3.c */; };
F37A8D4A2838A23400C38E95 /* music_drflac.h in Headers */ = {isa = PBXBuildFile; fileRef = F37A8D412838A23400C38E95 /* music_drflac.h */; };
F37A8D502838A23400C38E95 /* music_drflac.c in Sources */ = {isa = PBXBuildFile; fileRef = F37A8D492838A23400C38E95 /* music_drflac.c */; };
F37A8DB52838AD1300C38E95 /* music_ogg_stb.c in Sources */ = {isa = PBXBuildFile; fileRef = F37A8DB42838AD1200C38E95 /* music_ogg_stb.c */; };
@@ -213,9 +213,9 @@
F30240622881DF95002F32D6 /* music_xmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = music_xmp.c; sourceTree = "<group>"; };
F307A25D2B542F110012534B /* wavpack.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = wavpack.xcodeproj; path = wavpack/wavpack.xcodeproj; sourceTree = "<group>"; };
F307A2732B5431700012534B /* gme.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = gme.xcodeproj; path = gme/gme.xcodeproj; sourceTree = "<group>"; };
+ F307A52D2B5473760012534B /* music_minimp3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = music_minimp3.c; sourceTree = "<group>"; };
+ F307A52E2B5473760012534B /* music_minimp3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = music_minimp3.h; sourceTree = "<group>"; };
F3249B36285C448100DB9B5C /* CMake */ = {isa = PBXFileReference; lastKnownFileType = folder; path = CMake; sourceTree = "<group>"; };
- F37A8D2B2838924900C38E95 /* music_drmp3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = music_drmp3.h; sourceTree = "<group>"; };
- F37A8D2C2838924900C38E95 /* music_drmp3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = music_drmp3.c; sourceTree = "<group>"; };
F37A8D412838A23400C38E95 /* music_drflac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = music_drflac.h; sourceTree = "<group>"; };
F37A8D492838A23400C38E95 /* music_drflac.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = music_drflac.c; sourceTree = "<group>"; };
F37A8DB42838AD1200C38E95 /* music_ogg_stb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = music_ogg_stb.c; sourceTree = "<group>"; };
@@ -325,14 +325,14 @@
AAE405DB1F9607C200EDAF53 /* music_cmd.h */,
F37A8D492838A23400C38E95 /* music_drflac.c */,
F37A8D412838A23400C38E95 /* music_drflac.h */,
- F37A8D2C2838924900C38E95 /* music_drmp3.c */,
- F37A8D2B2838924900C38E95 /* music_drmp3.h */,
AAE405D41F9607C100EDAF53 /* music_flac.c */,
AAE405C71F9607C000EDAF53 /* music_flac.h */,
AAE405C61F9607C000EDAF53 /* music_fluidsynth.c */,
AAE405BF1F9607BF00EDAF53 /* music_fluidsynth.h */,
F3F8794C29B30FDA0007FDA1 /* music_gme.c */,
F3F8794A29B30FDA0007FDA1 /* music_gme.h */,
+ F307A52D2B5473760012534B /* music_minimp3.c */,
+ F307A52E2B5473760012534B /* music_minimp3.h */,
AAE405C41F9607C000EDAF53 /* music_modplug.c */,
AAE405C51F9607C000EDAF53 /* music_modplug.h */,
AAE405DF1F9607C300EDAF53 /* music_mpg123.c */,
@@ -472,9 +472,9 @@
files = (
AAE405E31F9607C300EDAF53 /* music_fluidsynth.h in Headers */,
AAE405F61F9607C300EDAF53 /* load_aiff.h in Headers */,
+ F307A5302B5473760012534B /* music_minimp3.h in Headers */,
AAE405E71F9607C300EDAF53 /* load_voc.h in Headers */,
AAE405EC1F9607C300EDAF53 /* music_wav.h in Headers */,
- F37A8D2D2838924900C38E95 /* music_drmp3.h in Headers */,
AAE405E91F9607C300EDAF53 /* music_modplug.h in Headers */,
AAE405FE1F9607C300EDAF53 /* music_nativemidi.h in Headers */,
F37A8D4A2838A23400C38E95 /* music_drflac.h in Headers */,
@@ -695,7 +695,6 @@
buildActionMask = 2147483647;
files = (
AAE405E21F9607C300EDAF53 /* load_aiff.c in Sources */,
- F37A8D2F2838924900C38E95 /* music_drmp3.c in Sources */,
AAE405F01F9607C300EDAF53 /* load_voc.c in Sources */,
AAE405EA1F9607C300EDAF53 /* music_fluidsynth.c in Sources */,
AAE405FD1F9607C300EDAF53 /* music_ogg.c in Sources */,
@@ -715,6 +714,7 @@
AAE406041F9607C300EDAF53 /* effect_stereoreverse.c in Sources */,
AAE405ED1F9607C300EDAF53 /* music_wav.c in Sources */,
F30240652881DF95002F32D6 /* music_xmp.c in Sources */,
+ F307A52F2B5473760012534B /* music_minimp3.c in Sources */,
AAE405E81F9607C300EDAF53 /* music_modplug.c in Sources */,
AAE405E51F9607C300EDAF53 /* mixer.c in Sources */,
0448E8AE108B937A00C9D3EA /* native_midi_macosx.c in Sources */,
@@ -779,7 +779,7 @@
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
MUSIC_FLAC_DRFLAC,
- MUSIC_MP3_DRMP3,
+ MUSIC_MP3_MINIMP3,
MUSIC_OGG,
OGG_USE_STB,
MUSIC_WAV,
@@ -826,7 +826,7 @@
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
MUSIC_FLAC_DRFLAC,
- MUSIC_MP3_DRMP3,
+ MUSIC_MP3_MINIMP3,
MUSIC_OGG,
OGG_USE_STB,
MUSIC_WAV,
diff --git a/external/SDL b/external/SDL
index 8a1afc9b..649556be 160000
--- a/external/SDL
+++ b/external/SDL
@@ -1 +1 @@
-Subproject commit 8a1afc9b10e9153f764f562008795b415d0575e1
+Subproject commit 649556befa156201116a4f25089597463d0efd44
diff --git a/src/codecs/dr_libs/dr_mp3.h b/src/codecs/dr_libs/dr_mp3.h
deleted file mode 100644
index 84849ee4..00000000
--- a/src/codecs/dr_libs/dr_mp3.h
+++ /dev/null
@@ -1,4834 +0,0 @@
-/*
-MP3 audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file.
-dr_mp3 - v0.6.38 - 2023-11-02
-
-David Reid - mackron@gmail.com
-
-GitHub: https://github.com/mackron/dr_libs
-
-Based on minimp3 (https://github.com/lieff/minimp3) which is where the real work was done. See the bottom of this file for differences between minimp3 and dr_mp3.
-*/
-
-/*
-RELEASE NOTES - VERSION 0.6
-===========================
-Version 0.6 includes breaking changes with the configuration of decoders. The ability to customize the number of output channels and the sample rate has been
-removed. You must now use the channel count and sample rate reported by the MP3 stream itself, and all channel and sample rate conversion must be done
-yourself.
-
-
-Changes to Initialization
--------------------------
-Previously, `drmp3_init()`, etc. took a pointer to a `drmp3_config` object that allowed you to customize the output channels and sample rate. This has been
-removed. If you need the old behaviour you will need to convert the data yourself or just not upgrade. The following APIs have changed.
-
- `drmp3_init()`
- `drmp3_init_memory()`
- `drmp3_init_file()`
-
-
-Miscellaneous Changes
----------------------
-Support for loading a file from a `wchar_t` string has been added via the `drmp3_init_file_w()` API.
-*/
-
-/*
-Introducation
-=============
-dr_mp3 is a single file library. To use it, do something like the following in one .c file.
-
- ```c
- #define DR_MP3_IMPLEMENTATION
- #include "dr_mp3.h"
- ```
-
-You can then #include this file in other parts of the program as you would with any other header file. To decode audio data, do something like the following:
-
- ```c
- drmp3 mp3;
- if (!drmp3_init_file(&mp3, "MySong.mp3", NULL)) {
- // Failed to open file
- }
-
- ...
-
- drmp3_uint64 framesRead = drmp3_read_pcm_frames_f32(pMP3, framesToRead, pFrames);
- ```
-
-The drmp3 object is transparent so you can get access to the channel count and sample rate like so:
-
- ```
- drmp3_uint32 channels = mp3.channels;
- drmp3_uint32 sampleRate = mp3.sampleRate;
- ```
-
-The example above initializes a decoder from a file, but you can also initialize it from a block of memory and read and seek callbacks with
-`drmp3_init_memory
(Patch may be truncated, please check the link at the top of this post.)