diff --git a/quakespasm/Quake/Makefile b/quakespasm/Quake/Makefile
index 45322db1..d89f0cdd 100644
--- a/quakespasm/Quake/Makefile
+++ b/quakespasm/Quake/Makefile
@@ -19,6 +19,9 @@ USE_CODEC_WAVE=1
USE_CODEC_MP3=1
USE_CODEC_VORBIS=1
+# which library to use for mp3 decoding: mad or mpg123
+MP3LIB=mad
+
# ============================================================================
# Helper functions
# ============================================================================
@@ -121,6 +124,17 @@ ifeq ($(USE_QS_CONBACK),1)
CFLAGS+= -DUSE_QS_CONBACK
endif
+ifeq ($(MP3LIB),mad)
+mp3_obj=snd_mp3.o
+else
+ifeq ($(MP3LIB),mpg123)
+mp3_obj=snd_mpg123.o
+else
+USE_CODEC_MP3=no
+mp3_obj=snd_mp3.o
+endif
+endif
+
CODECLIBS :=
ifeq ($(USE_CODEC_WAVE),1)
CFLAGS+= -DUSE_CODEC_WAVE
@@ -131,7 +145,7 @@ CODECLIBS+= vorbis vorbisfile ogg
endif
ifeq ($(USE_CODEC_MP3),1)
CFLAGS+= -DUSE_CODEC_MP3
-CODECLIBS+= mad
+CODECLIBS+= $(MP3LIB)
endif
COMMON_LIBS:= m GL
@@ -161,7 +175,7 @@ MUSIC_OBJS:= bgmusic.o \
snd_codec.o \
snd_wave.o \
snd_vorbis.o \
- snd_mp3.o
+ $(mp3_obj)
COMOBJ_SND := snd_dma.o snd_mix.o snd_mem.o $(MUSIC_OBJS)
SYSOBJ_SND := snd_sdl.o
SYSOBJ_CDA := cd_sdl.o
diff --git a/quakespasm/Quake/Makefile.darwin b/quakespasm/Quake/Makefile.darwin
index cfcc44b7..cea016b5 100644
--- a/quakespasm/Quake/Makefile.darwin
+++ b/quakespasm/Quake/Makefile.darwin
@@ -18,6 +18,9 @@ USE_CODEC_WAVE=1
USE_CODEC_MP3=1
USE_CODEC_VORBIS=1
+# which library to use for mp3 decoding: mad or mpg123
+MP3LIB=mad
+
# ============================================================================
# Helper functions
# ============================================================================
@@ -127,6 +130,17 @@ ifeq ($(USE_QS_CONBACK),1)
CFLAGS+= -DUSE_QS_CONBACK
endif
+ifeq ($(MP3LIB),mad)
+mp3_obj=snd_mp3.o
+else
+ifeq ($(MP3LIB),mpg123)
+mp3_obj=snd_mpg123.o
+else
+USE_CODEC_MP3=no
+mp3_obj=snd_mp3.o
+endif
+endif
+
# FIXME: The codec libs stuff are copied over from the unix makefile
# They might need adaptations for Darwin
CODECLIBS :=
@@ -139,7 +153,7 @@ CODECLIBS+= -lvorbis -lvorbisfile -logg
endif
ifeq ($(USE_CODEC_MP3),1)
CFLAGS+= -DUSE_CODEC_MP3
-CODECLIBS+= -lmad
+CODECLIBS+= -l$(MP3LIB)
endif
COMMON_LIBS = -Wl,-framework,OpenGL
@@ -170,7 +184,7 @@ MUSIC_OBJS:= bgmusic.o \
snd_codec.o \
snd_wave.o \
snd_vorbis.o \
- snd_mp3.o
+ $(mp3_obj)
COMOBJ_SND := snd_dma.o snd_mix.o snd_mem.o $(MUSIC_OBJS)
SYSOBJ_SND := snd_sdl.o
SYSOBJ_CDA := cd_sdl.o
diff --git a/quakespasm/Quake/Makefile.w32 b/quakespasm/Quake/Makefile.w32
index 6880a5db..8cb20a3d 100644
--- a/quakespasm/Quake/Makefile.w32
+++ b/quakespasm/Quake/Makefile.w32
@@ -14,6 +14,9 @@ USE_CODEC_WAVE=1
USE_CODEC_MP3=1
USE_CODEC_VORBIS=1
+# which library to use for mp3 decoding: mad or mpg123
+MP3LIB=mad
+
# ============================================================================
# Helper functions
# ============================================================================
@@ -93,6 +96,17 @@ ifeq ($(USE_QS_CONBACK),1)
CFLAGS+= -DUSE_QS_CONBACK
endif
+ifeq ($(MP3LIB),mad)
+mp3_obj=snd_mp3.o
+else
+ifeq ($(MP3LIB),mpg123)
+mp3_obj=snd_mpg123.o
+else
+USE_CODEC_MP3=no
+mp3_obj=snd_mp3.o
+endif
+endif
+
CODECLIBS :=
ifeq ($(USE_CODEC_WAVE),1)
CFLAGS+= -DUSE_CODEC_WAVE
@@ -109,7 +123,7 @@ ifeq ($(USE_CODEC_MP3),1)
CFLAGS+= -DUSE_CODEC_MP3
CODEC_INC = -I../Windows/codecs/include
CODEC_LINK= -L../Windows/codecs/x86
-CODECLIBS+= -lmad
+CODECLIBS+= -l$(MP3LIB)
endif
CFLAGS+= $(CODEC_INC)
@@ -142,7 +156,7 @@ MUSIC_OBJS:= bgmusic.o \
snd_codec.o \
snd_wave.o \
snd_vorbis.o \
- snd_mp3.o
+ $(mp3_obj)
COMOBJ_SND := snd_dma.o snd_mix.o snd_mem.o $(MUSIC_OBJS)
SYSOBJ_SND := snd_sdl.o
SYSOBJ_CDA := cd_sdl.o
diff --git a/quakespasm/Quake/Makefile.w64 b/quakespasm/Quake/Makefile.w64
index 6947c063..ea9b3ffc 100644
--- a/quakespasm/Quake/Makefile.w64
+++ b/quakespasm/Quake/Makefile.w64
@@ -14,6 +14,9 @@ USE_CODEC_WAVE=1
USE_CODEC_MP3=1
USE_CODEC_VORBIS=1
+# which library to use for mp3 decoding: mad or mpg123
+MP3LIB=mad
+
# ============================================================================
# Helper functions
# ============================================================================
@@ -93,6 +96,17 @@ ifeq ($(USE_QS_CONBACK),1)
CFLAGS+= -DUSE_QS_CONBACK
endif
+ifeq ($(MP3LIB),mad)
+mp3_obj=snd_mp3.o
+else
+ifeq ($(MP3LIB),mpg123)
+mp3_obj=snd_mpg123.o
+else
+USE_CODEC_MP3=no
+mp3_obj=snd_mp3.o
+endif
+endif
+
CODECLIBS :=
ifeq ($(USE_CODEC_WAVE),1)
CFLAGS+= -DUSE_CODEC_WAVE
@@ -109,7 +123,7 @@ ifeq ($(USE_CODEC_MP3),1)
CFLAGS+= -DUSE_CODEC_MP3
CODEC_INC = -I../Windows/codecs/include
CODEC_LINK= -L../Windows/codecs/x64
-CODECLIBS+= -lmad
+CODECLIBS+= -l$(MP3LIB)
endif
CFLAGS+= $(CODEC_INC)
@@ -142,7 +156,7 @@ MUSIC_OBJS:= bgmusic.o \
snd_codec.o \
snd_wave.o \
snd_vorbis.o \
- snd_mp3.o
+ $(mp3_obj)
COMOBJ_SND := snd_dma.o snd_mix.o snd_mem.o $(MUSIC_OBJS)
SYSOBJ_SND := snd_sdl.o
SYSOBJ_CDA := cd_sdl.o
diff --git a/quakespasm/Quake/snd_mp3.h b/quakespasm/Quake/snd_mp3.h
index 69a1c973..d54ae4dc 100644
--- a/quakespasm/Quake/snd_mp3.h
+++ b/quakespasm/Quake/snd_mp3.h
@@ -1,4 +1,4 @@
-/* MP3 decoding support using libmad. */
+/* MP3 decoding support using libmad or libmpg123. */
#if !defined(_SND_MP3_H_)
#define _SND_MP3_H_
diff --git a/quakespasm/Quake/snd_mpg123.c b/quakespasm/Quake/snd_mpg123.c
new file mode 100644
index 00000000..6e69a514
--- /dev/null
+++ b/quakespasm/Quake/snd_mpg123.c
@@ -0,0 +1,225 @@
+/*
+ * MP3 decoding support using libmpg123, loosely based on an SDL_mixer
+ * plugin found at http://bubu.lv/
+ * See: http://bubu.lv/changeset/4/public/libs/SDL/generated/SDL_mixer
+ *
+ * Copyright (C) 2011 O.Sezer
Streaming music playback requires "libmad" for MP3, and "libogg", "libvorbis" for OGG files.
+Streaming music playback requires "libmad" or "libmpg123" for MP3, and "libogg" and "libvorbis" for OGG files.
HOME directory support can be enabled via the Misc/homedir_0.patch
The project can also be built with Codeblocks (project files included).
. diff --git a/quakespasm/README.sgml b/quakespasm/README.sgml index 4adb0fcb..cf87465f 100644 --- a/quakespasm/README.sgml +++ b/quakespasm/README.sgml @@ -66,7 +66,7 @@ Compile time options includeStreaming music playback requires "libmad" for MP3, and "libogg", "libvorbis" for OGG files. +
Streaming music playback requires "libmad" or "libmpg123" for MP3, and "libogg" and "libvorbis" for OGG files.
HOME directory support can be enabled via the
The project can also be built with Codeblocks (project files included).
. diff --git a/quakespasm/README.txt b/quakespasm/README.txt index 1cf057c3..fa570070 100644 --- a/quakespasm/README.txt +++ b/quakespasm/README.txt @@ -109,8 +109,8 @@ o make SDL_CONFIG=/PATH/TO/SDL-CONFIG for unusual SDL installs - Streaming music playback requires "libmad" for MP3, and "libogg", - "libvorbis" for OGG files. + Streaming music playback requires "libmad" or "libmpg123" for MP3, and + "libogg" and "libvorbis" for OGG files. HOME directory support can be enabled via the Misc/homedir_0.patch