SDL_mixer: Added MP3 support using minimp3

From fbf6f67729bc892e297e136cd18a226cbf656fe4 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 20 May 2022 14:43:22 -0700
Subject: [PATCH] Added MP3 support using minimp3

Support for minimp3 and other fixes from SDL-Mixer-X (thanks @Wohlstand!)
---
 Android.mk                                    |    7 +
 Makefile.in                                   |   27 +-
 README.txt                                    |    6 +-
 Xcode/SDL_mixer.xcodeproj/project.pbxproj     |   54 +-
 Xcode/config.xcconfig                         |    5 -
 .../playmus/playmus.xcodeproj/project.pbxproj |   34 -
 .../playwave.xcodeproj/project.pbxproj        |   34 -
 configure                                     |   56 +-
 configure.ac                                  |    9 +-
 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/mp3utils.c                         |  908 +++++++-
 src/codecs/mp3utils.h                         |   23 +-
 src/codecs/music_flac.c                       |    9 +-
 src/codecs/music_mad.c                        |   22 +-
 src/codecs/music_minimp3.c                    |  288 +++
 src/codecs/music_minimp3.h                    |   28 +
 src/codecs/music_modplug.c                    |   28 +-
 src/codecs/music_mpg123.c                     |   22 +-
 src/codecs/music_ogg.c                        |    8 +-
 src/codecs/music_opus.c                       |   10 +-
 src/codecs/music_wav.c                        |   46 +-
 src/codecs/music_xmp.c                        |    9 +-
 src/music.c                                   |    4 +
 src/music.h                                   |    1 +
 27 files changed, 5071 insertions(+), 256 deletions(-)
 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
 create mode 100644 src/codecs/music_minimp3.c
 create mode 100644 src/codecs/music_minimp3.h

diff --git a/Android.mk b/Android.mk
index 0da3bec1..b1342f98 100644
--- a/Android.mk
+++ b/Android.mk
@@ -13,6 +13,9 @@ SUPPORT_OGG ?= false
 OGG_LIBRARY_PATH := external/ogg
 VORBIS_LIBRARY_PATH := external/tremor
 
+# 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
 MPG123_LIBRARY_PATH := external/mpg123
@@ -94,6 +97,10 @@ ifeq ($(SUPPORT_OGG),true)
     LOCAL_STATIC_LIBRARIES += ogg vorbisidec
 endif
 
+ifeq ($(SUPPORT_MP3_MINIMP3),true)
+    LOCAL_CFLAGS += -DMUSIC_MP3_MINIMP3
+endif
+
 # This needs to be a shared library to comply with the LGPL license
 ifeq ($(SUPPORT_MP3_MPG123),true)
     LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MPG123_LIBRARY_PATH)
diff --git a/Makefile.in b/Makefile.in
index cccf3368..b0057ccb 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -39,7 +39,32 @@ VERSION_OBJECTS = @VERSION_OBJECTS@
 PLAYWAVE_OBJECTS = @PLAYWAVE_OBJECTS@
 PLAYMUS_OBJECTS = @PLAYMUS_OBJECTS@
 
-SRC_DIST = LICENSE.txt README.txt CHANGES.txt .gitmodules Android.mk CMakeLists.txt Makefile.in Makefile.os2 SDL2_mixer.pc.in SDL2_mixer.spec.in include/SDL_mixer.h VisualC VisualC-WinRT Xcode acinclude autogen.sh build-scripts configure configure.ac external/download.sh src/utils.c src/utils.h src/effect_position.c src/effect_stereoreverse.c src/effects_internal.c src/effects_internal.h src/codecs/load_aiff.c src/codecs/load_aiff.h src/codecs/load_voc.c src/codecs/load_voc.h src/codecs/mp3utils.c src/codecs/mp3utils.h src/mixer.c src/mixer.h src/music.c src/music.h src/codecs/music_cmd.c src/codecs/music_cmd.h src/codecs/music_flac.c src/codecs/music_flac.h src/codecs/music_fluidsynth.c src/codecs/music_fluidsynth.h src/codecs/music_mad.c src/codecs/music_mad.h src/codecs/music_mikmod.c src/codecs/music_mikmod.h src/codecs/music_modplug.c src/codecs/music_modplug.h src/codecs/music_xmp.c src/codecs/music_xmp.h src/codecs/music_mpg123.c src/codecs/music_mpg123.h src/codecs/music_nativemidi.c src/codecs/music_nativemidi.h src/codecs/music_ogg.c src/codecs/music_ogg.h src/codecs/music_opus.c src/codecs/music_opus.h src/codecs/music_timidity.c src/codecs/music_timidity.h src/codecs/music_wav.c src/codecs/music_wav.h src/codecs/native_midi playmus.c playwave.c src/codecs/timidity version.rc
+SRC_DIST =			\
+	LICENSE.txt		\
+	README.txt		\
+	CHANGES.txt		\
+	.gitmodules		\
+	Android.mk		\
+	CMakeLists.txt		\
+	Makefile.in		\
+	Makefile.os2		\
+	SDL2_mixer.pc.in	\
+	SDL2_mixer.spec.in	\
+	include/SDL_mixer.h	\
+	VisualC			\
+	VisualC-WinRT		\
+	Xcode			\
+	acinclude		\
+	autogen.sh		\
+	build-scripts		\
+	configure		\
+	configure.ac		\
+	external/download.sh	\
+	src			\
+	playmus.c		\
+	playwave.c		\
+	version.rc
+
 GEN_DIST = SDL2_mixer.spec
 
 LT_AGE      = @LT_AGE@
diff --git a/README.txt b/README.txt
index 62ecde93..db1c6a78 100644
--- a/README.txt
+++ b/README.txt
@@ -5,7 +5,7 @@ The latest version of this library is available from:
 http://www.libsdl.org/projects/SDL_mixer/
 
 Due to popular demand, here is a simple multi-channel audio mixer.
-It supports 8 channels of 16 bit stereo audio, plus a single channel of music. It can load VOC and WAV format audio. It can also load FLAC, MIDI, MOD, MP3, Ogg, and Opus audio, depending on build options (see the note below for details.)
+It supports 8 channels of 16 bit stereo audio, plus a single channel of music. It can load MP3, VOC, and WAV format audio. It can also load FLAC, MIDI, MOD, Ogg, and Opus audio, depending on build options (see the note below for details.)
 
 See the header file SDL_mixer.h and the examples playwave.c and playmus.c
 for documentation on this mixer library.
@@ -22,13 +22,13 @@ and unpack them in /usr/local/lib under UNIX, and C:\ under Win32.
 This library is under the zlib license, see the file "LICENSE.txt" for details.
 
 Note:
-Support for FLAC, software MIDI, MOD, MP3, Ogg, and Opus are not included by default because of the size of the decode libraries, but you can get them by running external/download.sh
+Support for FLAC, software MIDI, MOD, Ogg, and Opus are not included by default because of the size of the decode libraries, but you can get them by running external/download.sh
 - When building with CMake, you can enable the appropriate SUPPORT_* options defined in CMakeLists.txt.
 - When building with configure/make, you can build and install them normally and the configure script will detect and use them.
 - When building with Visual Studio, you will need to build the libraries and then add the appropriate LOAD_* preprocessor define to the Visual Studio project.
 - 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 mpg123. SDL_mixer also supports using libmad, but does not use it by default because the libmad license is GPL, which requires your application to also be GPL. If your application has a compatible license, you can enable libmad by passing
+The default MP3 support is provided using minimp3. SDL_mixer also supports using libmad, but does not use it by default because the libmad license is GPL, which requires your application to also be GPL. If your application has a compatible license, you can enable libmad by passing
 	--enable-music-mp3-mad
 to configure, or by defining MUSIC_MP3_MAD
diff --git a/Xcode/SDL_mixer.xcodeproj/project.pbxproj b/Xcode/SDL_mixer.xcodeproj/project.pbxproj
index 1fdcd453..65162864 100644
--- a/Xcode/SDL_mixer.xcodeproj/project.pbxproj
+++ b/Xcode/SDL_mixer.xcodeproj/project.pbxproj
@@ -50,6 +50,10 @@
 		AAE406041F9607C300EDAF53 /* effect_stereoreverse.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE405E01F9607C300EDAF53 /* effect_stereoreverse.c */; };
 		AAE406051F9607C300EDAF53 /* effects_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE405E11F9607C300EDAF53 /* effects_internal.h */; };
 		BE1FA8CD07AF96B2004B6283 /* SDL_mixer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1014BAEA010A4B677F000001 /* SDL_mixer.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		F37A8CCA2838404700C38E95 /* music_minimp3.h in Headers */ = {isa = PBXBuildFile; fileRef = F37A8CC82838404700C38E95 /* music_minimp3.h */; };
+		F37A8CCB2838404700C38E95 /* music_minimp3.h in Headers */ = {isa = PBXBuildFile; fileRef = F37A8CC82838404700C38E95 /* music_minimp3.h */; };
+		F37A8CCC2838404700C38E95 /* music_minimp3.c in Sources */ = {isa = PBXBuildFile; fileRef = F37A8CC92838404700C38E95 /* music_minimp3.c */; };
+		F37A8CCD2838404700C38E95 /* music_minimp3.c in Sources */ = {isa = PBXBuildFile; fileRef = F37A8CC92838404700C38E95 /* music_minimp3.c */; };
 		F3823337273195CC00F7F527 /* utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 639008C62385A822009019FA /* utils.c */; };
 		F3823338273195CF00F7F527 /* utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 639008C72385A822009019FA /* utils.h */; };
 		F3823339273195D200F7F527 /* effect_position.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE405D01F9607C100EDAF53 /* effect_position.c */; };
@@ -113,13 +117,6 @@
 			remoteGlobalIDString = F3968A21281F704800661875;
 			remoteInfo = opus;
 		};
-		F3968D65281FB43300661875 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = F3968D60281FB43300661875 /* mpg123.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = F3968BA5281F855B00661875;
-			remoteInfo = mpg123;
-		};
 		F3968D77281FB66200661875 /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
 			containerPortal = F3968D72281FB66200661875 /* tremor.xcodeproj */;
@@ -197,8 +194,9 @@
 		BE1FA90607AF96B2004B6283 /* SDL2_mixer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL2_mixer.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		BE1FA95407AF96B2004B6283 /* libSDL2_mixer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2_mixer.a; sourceTree = BUILT_PRODUCTS_DIR; };
 		BE1FA95807AF96B3004B6283 /* Create DMG */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "Create DMG"; sourceTree = BUILT_PRODUCTS_DIR; };
+		F37A8CC82838404700C38E95 /* music_minimp3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = music_minimp3.h; sourceTree = "<group>"; };
+		F37A8CC92838404700C38E95 /* music_minimp3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = music_minimp3.c; sourceTree = "<group>"; };
 		F3968B90281F817E00661875 /* opus.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = opus.xcodeproj; path = opus/opus.xcodeproj; sourceTree = "<group>"; };
-		F3968D60281FB43300661875 /* mpg123.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = mpg123.xcodeproj; path = mpg123/mpg123.xcodeproj; sourceTree = "<group>"; };
 		F3968D71281FB5E100661875 /* config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = config.xcconfig; sourceTree = "<group>"; };
 		F3968D72281FB66200661875 /* tremor.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = tremor.xcodeproj; path = tremor/tremor.xcodeproj; sourceTree = "<group>"; };
 		F3968DEA281FBFE100661875 /* libmodplug.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libmodplug.xcodeproj; path = libmodplug/libmodplug.xcodeproj; sourceTree = "<group>"; };
@@ -262,7 +260,6 @@
 				F3968D71281FB5E100661875 /* config.xcconfig */,
 				F3F70EC6281F5ABA005AA27D /* FLAC.xcodeproj */,
 				F3968DEA281FBFE100661875 /* libmodplug.xcodeproj */,
-				F3968D60281FB43300661875 /* mpg123.xcodeproj */,
 				F3968B90281F817E00661875 /* opus.xcodeproj */,
 				F3968D72281FB66200661875 /* tremor.xcodeproj */,
 				F3F70F9A281F6DCA005AA27D /* vorbis.xcodeproj */,
@@ -296,6 +293,10 @@
 		6398B0BB238528360024EEA1 /* codecs */ = {
 			isa = PBXGroup;
 			children = (
+				AAE405BE1F9607BF00EDAF53 /* load_aiff.c */,
+				AAE405D21F9607C100EDAF53 /* load_aiff.h */,
+				AAE405CC1F9607C000EDAF53 /* load_voc.c */,
+				AAE405C31F9607C000EDAF53 /* load_voc.h */,
 				639197EF239FE66700F1D8F8 /* mp3utils.c */,
 				639197F0239FE66700F1D8F8 /* mp3utils.h */,
 				AAE405DE1F9607C300EDAF53 /* music_cmd.c */,
@@ -308,6 +309,8 @@
 				AAE405DD1F9607C300EDAF53 /* music_mad.h */,
 				AAE405D81F9607C200EDAF53 /* music_mikmod.c */,
 				AAE405CF1F9607C100EDAF53 /* music_mikmod.h */,
+				F37A8CC92838404700C38E95 /* music_minimp3.c */,
+				F37A8CC82838404700C38E95 /* music_minimp3.h */,
 				AAE405C41F9607C000EDAF53 /* music_modplug.c */,
 				AAE405C51F9607C000EDAF53 /* music_modplug.h */,
 				AAE405DF1F9607C300EDAF53 /* music_mpg123.c */,
@@ -316,16 +319,12 @@
 				AAE405DA1F9607C200EDAF53 /* music_nativemidi.h */,
 				AAE405D91F9607C200EDAF53 /* music_ogg.c */,
 				AAE405D11F9607C100EDAF53 /* music_ogg.h */,
+				630FBD8220D52105009867AB /* music_opus.c */,
+				630FBD8420D5211F009867AB /* music_opus.h */,
 				AAE405D71F9607C200EDAF53 /* music_timidity.c */,
 				AAE405D61F9607C100EDAF53 /* music_timidity.h */,
 				AAE405C91F9607C000EDAF53 /* music_wav.c */,
 				AAE405C81F9607C000EDAF53 /* music_wav.h */,
-				AAE405BE1F9607BF00EDAF53 /* load_aiff.c */,
-				AAE405D21F9607C100EDAF53 /* load_aiff.h */,
-				AAE405CC1F9607C000EDAF53 /* load_voc.c */,
-				AAE405C31F9607C000EDAF53 /* load_voc.h */,
-				630FBD8420D5211F009867AB /* music_opus.h */,
-				630FBD8220D52105009867AB /* music_opus.c */,
 			);
 			name = codecs;
 			path = ../src/codecs;
@@ -368,14 +367,6 @@
 			name = Products;
 			sourceTree = "<group>";
 		};
-		F3968D61281FB43300661875 /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				F3968D66281FB43300661875 /* mpg123.framework */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
 		F3968D73281FB66200661875 /* Products */ = {
 			isa = PBXGroup;
 			children = (
@@ -449,6 +440,7 @@
 				AAE405E71F9607C300EDAF53 /* load_voc.h in Headers */,
 				AAE405EC1F9607C300EDAF53 /* music_wav.h in Headers */,
 				AAE406011F9607C300EDAF53 /* music_mad.h in Headers */,
+				F37A8CCA2838404700C38E95 /* music_minimp3.h in Headers */,
 				AAE405E91F9607C300EDAF53 /* music_modplug.h in Headers */,
 				AAE405FE1F9607C300EDAF53 /* music_nativemidi.h in Headers */,
 				AAE405E41F9607C300EDAF53 /* mixer.h in Headers */,
@@ -485,6 +477,7 @@
 				F38233562731961C00F7F527 /* music_timidity.h in Headers */,
 				F38233542731961800F7F527 /* music_ogg.h in Headers */,
 				F382335C2731962B00F7F527 /* load_voc.h in Headers */,
+				F37A8CCB2838404700C38E95 /* music_minimp3.h in Headers */,
 				F382335D2731962D00F7F527 /* music_opus.h in Headers */,
 				F3823342273195E900F7F527 /* mp3utils.h in Headers */,
 				F38233602731963800F7F527 /* native_midi.h in Headers */,
@@ -583,10 +576,6 @@
 					ProductGroup = F3968DEB281FBFE100661875 /* Products */;
 					ProjectRef = F3968DEA281FBFE100661875 /* libmodplug.xcodeproj */;
 				},
-				{
-					ProductGroup = F3968D61281FB43300661875 /* Products */;
-					ProjectRef = F3968D60281FB43300661875 /* mpg123.xcodeproj */;
-				},
 				{
 					ProductGroup = F3968B91281F817E00661875 /* Products */;
 					ProjectRef = F3968B90281F817E00661875 /* opus.xcodeproj */;
@@ -617,13 +606,6 @@
 			remoteRef = F3968B96281F817E00661875 /* PBXContainerItemProxy */;
 			sourceTree = BUILT_PRODUCTS_DIR;
 		};
-		F3968D66281FB43300661875 /* mpg123.framework */ = {
-			isa = PBXReferenceProxy;
-			fileType = wrapper.framework;
-			path = mpg123.framework;
-			remoteRef = F3968D65281FB43300661875 /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
 		F3968D78281FB66200661875 /* tremor.framework */ = {
 			isa = PBXReferenceProxy;
 			fileType = wrapper.framework;
@@ -732,6 +714,7 @@
 				AAE405E51F9607C300EDAF53 /* mixer.c in Sources */,
 				0448E8AE108B937A00C9D3EA /* native_midi_macosx.c in Sources */,
 				630FBD8320D52105009867AB /* music_opus.c in Sources */,
+				F37A8CCC2838404700C38E95 /* music_minimp3.c in Sources */,
 				639008C82385A822009019FA /* utils.c in Sources */,
 				639197F1239FE66700F1D8F8 /* mp3utils.c in Sources */,
 			);
@@ -761,6 +744,7 @@
 				F38233572731961F00F7F527 /* music_wav.c in Sources */,
 				F38233512731961100F7F527 /* music_nativemidi.c in Sources */,
 				F38233532731961600F7F527 /* music_ogg.c in Sources */,
+				F37A8CCD2838404700C38E95 /* music_minimp3.c in Sources */,
 				F3823337273195CC00F7F527 /* utils.c in Sources */,
 				F3823339273195D200F7F527 /* effect_position.c in Sources */,
 			);
@@ -861,6 +845,7 @@
 				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
 				GCC_NO_COMMON_BLOCKS = YES;
 				GCC_PREPROCESSOR_DEFINITIONS = (
+					MUSIC_MP3_MINIMP3,
 					MUSIC_WAV,
 					"$(CONFIG_PREPROCESSOR_DEFINITIONS)",
 				);
@@ -907,6 +892,7 @@
 				GCC_NO_COMMON_BLOCKS = YES;
 				GCC_OPTIMIZATION_LEVEL = 0;
 				GCC_PREPROCESSOR_DEFINITIONS = (
+					MUSIC_MP3_MINIMP3,
 					MUSIC_WAV,
 					"$(CONFIG_PREPROCESSOR_DEFINITIONS)",
 				);
diff --git a/Xcode/config.xcconfig b/Xcode/config.xcconfig
index e2940009..e754a63f 100644
--- a/Xcode/config.xcconfig
+++ b/Xcode/config.xcconfig
@@ -19,11 +19,6 @@
 //CONFIG_PREPROCESSOR_DEFINITIONS = $(inherited) MUSIC_MOD
 //CONFIG_FRAMEWORK_LDFLAGS = $(inherited) -weak_framework libmodplug
 
-// Uncomment these lines to enable MP3 support
-// If you do this, you should run external/download.sh to download the decode libraries and add mpg123.framework to your application bundle.
-//CONFIG_PREPROCESSOR_DEFINITIONS = $(inherited) MUSIC_MP3_MPG123 MPG123_HEADER="<mpg123/mpg123.h>"
-//CONFIG_FRAMEWORK_LDFLAGS = $(inherited) -weak_framework mpg123
-
 // Uncomment these lines to enable Ogg support
 // If you do this, you should run external/download.sh to download the decode libraries and add vorbis.framework and tremor.framework to your application bundle.
 //CONFIG_PREPROCESSOR_DEFINITIONS = $(inherited) MUSIC_OGG
diff --git a/Xcode/playmus/playmus.xcodeproj/project.pbxproj b/Xcode/playmus/playmus.xcodeproj/project.pbxproj
index 3f709e9f..e07b7a9c 100644
--- a/Xcode/playmus/playmus.xcodeproj/project.pbxproj
+++ b/Xcode/playmus/playmus.xcodeproj/project.pbxproj
@@ -14,21 +14,18 @@
 		F3968ECF28203F3100661875 /* SDL2_mixer.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3ED80D4281D9ED600C33C5B /* SDL2_mixer.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968ED028203F5800661875 /* FLAC.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968E98282038D200661875 /* FLAC.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968ED128203F5800661875 /* libmodplug.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968E9E282038D700661875 /* libmodplug.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
-		F3968ED228203F5800661875 /* mpg123.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EA4282038DB00661875 /* mpg123.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968ED328203F5800661875 /* ogg.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EBC2820390500661875 /* ogg.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968ED428203F5800661875 /* opus.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EAA282038E000661875 /* opus.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968ED628203F5800661875 /* vorbis.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EB6282038FB00661875 /* vorbis.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968EEF2820409F00661875 /* SDL2.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EC0282039AC00661875 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968EF0282040B300661875 /* FLAC.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968E98282038D200661875 /* FLAC.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968EF1282040B300661875 /* libmodplug.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968E9E282038D700661875 /* libmodplug.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
-		F3968EF2282040B300661875 /* mpg123.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EA4282038DB00661875 /* mpg123.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968EF3282040B300661875 /* ogg.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EBC2820390500661875 /* ogg.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968EF4282040B300661875 /* opus.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EAA282038E000661875 /* opus.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968EF5282040B300661875 /* tremor.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EB0282038F600661875 /* tremor.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968EF6282040B300661875 /* vorbis.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EB6282038FB00661875 /* vorbis.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968F0E2820428F00661875 /* FLAC.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968E98282038D200661875 /* FLAC.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968F0F2820428F00661875 /* libmodplug.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968E9E282038D700661875 /* libmodplug.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
-		F3968F102820428F00661875 /* mpg123.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EA4282038DB00661875 /* mpg123.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968F112820428F00661875 /* ogg.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EBC2820390500661875 /* ogg.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968F122820428F00661875 /* opus.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EAA282038E000661875 /* opus.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968F132820428F00661875 /* vorbis.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EB6282038FB00661875 /* vorbis.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@@ -60,13 +57,6 @@
 			remoteGlobalIDString = F3968D85281FBB1900661875;
 			remoteInfo = libmodplug;
 		};
-		F3968EA3282038DB00661875 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = F3968E9F282038DB00661875 /* mpg123.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = F3968BA5281F855B00661875;
-			remoteInfo = mpg123;
-		};
 		F3968EA9282038E000661875 /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
 			containerPortal = F3968EA5282038E000661875 /* opus.xcodeproj */;
@@ -129,7 +119,6 @@
 				F39CD44B281DC6C8006CF638 /* SDL2_mixer.framework in Copy Frameworks */,
 				F3968F0E2820428F00661875 /* FLAC.framework in Copy Frameworks */,
 				F3968F0F2820428F00661875 /* libmodplug.framework in Copy Frameworks */,
-				F3968F102820428F00661875 /* mpg123.framework in Copy Frameworks */,
 				F3968F112820428F00661875 /* ogg.framework in Copy Frameworks */,
 				F3968F122820428F00661875 /* opus.framework in Copy Frameworks */,
 				F3968F132820428F00661875 /* vorbis.framework in Copy Frameworks */,
@@ -147,7 +136,6 @@
 				F3968ECF28203F3100661875 /* SDL2_mixer.framework in Copy Frameworks */,
 				F3968ED028203F5800661875 /* FLAC.framework in Copy Frameworks */,
 				F3968ED128203F5800661875 /* libmodplug.framework in Copy Frameworks */,
-				F3968ED228203F5800661875 /* mpg123.framework in Copy Frameworks */,
 				F3968ED328203F5800661875 /* ogg.framework in Copy Frameworks */,
 				F3968ED428203F5800661875 /* opus.framework in Copy Frameworks */,
 				F3968ED628203F5800661875 /* vorbis.framework in Copy Frameworks */,
@@ -165,7 +153,6 @@
 				F3ED80FF281DA63000C33C5B /* SDL2_mixer.framework in Copy Frameworks */,
 				F3968EF0282040B300661875 /* FLAC.framework in Copy Frameworks */,
 				F3968EF1282040B300661875 /* libmodplug.framework in Copy Frameworks */,
-				F3968EF2282040B300661875 /* mpg123.framework in Copy Frameworks */,
 				F3968EF3282040B300661875 /* ogg.framework in Copy Frameworks */,
 				F3968EF4282040B300661875 /* opus.framework in Copy Frameworks */,
 				F3968EF5282040B300661875 /* tremor.framework in Copy Frameworks */,
@@ -179,7 +166,6 @@
 /* Begin PBXFileReference section */
 		F3968E93282038D200661875 /* FLAC.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = FLAC.xcodeproj; path = ../FLAC/FLAC.xcodeproj; sourceTree = "<group>"; };
 		F3968E99282038D700661875 /* libmodplug.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libmodplug.xcodeproj; path = ../libmodplug/libmodplug.xcodeproj; sourceTree = "<group>"; };
-		F3968E9F282038DB00661875 /* mpg123.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = mpg123.xcodeproj; path = ../mpg123/mpg123.xcodeproj; sourceTree = "<group>"; };
 		F3968EA5282038E000661875 /* opus.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = opus.xcodeproj; path = ../opus/opus.xcodeproj; sourceTree = "<group>"; };
 		F3968EAB282038F600661875 /* tremor.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = tremor.xcodeproj; path = ../tremor/tremor.xcodeproj; sourceTree = "<group>"; };
 		F3968EB1282038FB00661875 /* vorbis.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = vorbis.xcodeproj; path = ../vorbis/vorbis.xcodeproj; sourceTree = "<group>"; };
@@ -243,14 +229,6 @@
 			name = Products;
 			sourceTree = "<group>";
 		};
-		F3968EA0282038DB00661875 /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				F3968EA4282038DB00661875 /* mpg123.framework */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
 		F3968EA6282038E000661875 /* Products */ = {
 			isa = PBXGroup;
 			children = (
@@ -322,7 +300,6 @@
 			children = (
 				F3968E93282038D200661875 /* FLAC.xcodeproj */,
 				F3968E99282038D700661875 /* libmodplug.xcodeproj */,
-				F3968E9F282038DB00661875 /* mpg123.xcodeproj */,
 				F3968EB72820390500661875 /* ogg.xcodeproj */,
 				F3968EA5282038E000661875 /* opus.xcodeproj */,
 				F3968EAB282038F600661875 /* tremor.xcodeproj */,
@@ -467,10 +444,6 @@
 					ProductGroup = F3968E9A282038D700661875 /* Products */;
 					ProjectRef = F3968E99282038D700661875 /* libmodplug.xcodeproj */;
 				},
-				{
-					ProductGroup = F3968EA0282038DB00661875 /* Products */;
-					ProjectRef = F3968E9F282038DB00661875 /* mpg123.xcodeproj */;
-				},
 				{
 					ProductGroup = F3968EB82820390500661875 /* Products */;
 					ProjectRef = F3968EB72820390500661875 /* ogg.xcodeproj */;
@@ -516,13 +489,6 @@
 			remoteRef = F3968E9D282038D700661875 /* PBXContainerItemProxy */;
 			sourceTree = BUILT_PRODUCTS_DIR;
 		};
-		F3968EA4282038DB00661875 /* mpg123.framework */ = {
-			isa = PBXReferenceProxy;
-			fileType = wrapper.framework;
-			path = mpg123.framework;
-			remoteRef = F3968EA3282038DB00661875 /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
 		F3968EAA282038E000661875 /* opus.framework */ = {
 			isa = PBXReferenceProxy;
 			fileType = wrapper.framework;
diff --git a/Xcode/playwave/playwave.xcodeproj/project.pbxproj b/Xcode/playwave/playwave.xcodeproj/project.pbxproj
index bd988d36..29751519 100644
--- a/Xcode/playwave/playwave.xcodeproj/project.pbxproj
+++ b/Xcode/playwave/playwave.xcodeproj/project.pbxproj
@@ -14,21 +14,18 @@
 		F3968ECF28203F3100661875 /* SDL2_mixer.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3ED80D4281D9ED600C33C5B /* SDL2_mixer.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968ED028203F5800661875 /* FLAC.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968E98282038D200661875 /* FLAC.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968ED128203F5800661875 /* libmodplug.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968E9E282038D700661875 /* libmodplug.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
-		F3968ED228203F5800661875 /* mpg123.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EA4282038DB00661875 /* mpg123.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968ED328203F5800661875 /* ogg.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EBC2820390500661875 /* ogg.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968ED428203F5800661875 /* opus.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EAA282038E000661875 /* opus.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968ED628203F5800661875 /* vorbis.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EB6282038FB00661875 /* vorbis.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968EEF2820409F00661875 /* SDL2.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EC0282039AC00661875 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968EF0282040B300661875 /* FLAC.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968E98282038D200661875 /* FLAC.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968EF1282040B300661875 /* libmodplug.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968E9E282038D700661875 /* libmodplug.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
-		F3968EF2282040B300661875 /* mpg123.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EA4282038DB00661875 /* mpg123.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968EF3282040B300661875 /* ogg.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EBC2820390500661875 /* ogg.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968EF4282040B300661875 /* opus.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F3968EAA282038E000661875 /* opus.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3968EF5282040B300661875 /* tremor.f

(Patch may be truncated, please check the link at the top of this post.)