Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update libsdl2-mixer to 2.8.0+dfsg-1 #1

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

40 changes: 40 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[submodule "external/flac"]
path = external/flac
url = https://github.com/libsdl-org/flac.git
branch = 1.3.4-SDL
[submodule "external/ogg"]
path = external/ogg
url = https://github.com/libsdl-org/ogg.git
branch = v1.3.5-SDL
[submodule "external/vorbis"]
path = external/vorbis
url = https://github.com/libsdl-org/vorbis.git
branch = v1.3.7-SDL
[submodule "external/opus"]
path = external/opus
url = https://github.com/libsdl-org/opus.git
branch = v1.4-SDL
[submodule "external/opusfile"]
path = external/opusfile
url = https://github.com/libsdl-org/opusfile.git
branch = v0.12-SDL
[submodule "external/tremor"]
path = external/tremor
url = https://github.com/libsdl-org/tremor.git
branch = v1.2.1-SDL
[submodule "external/mpg123"]
path = external/mpg123
url = https://github.com/libsdl-org/mpg123.git
branch = v1.31.3-SDL
[submodule "libxmp"]
path = external/libxmp
url = https://github.com/libsdl-org/libxmp.git
branch = 4.6.x-SDL
[submodule "external/wavpack"]
path = external/wavpack
url = https://github.com/libsdl-org/wavpack.git
branch = 5.6.0-sdl
[submodule "external/libgme"]
path = external/libgme
url = https://github.com/libsdl-org/game-music-emu.git
branch = v0.6.3-SDL
113 changes: 89 additions & 24 deletions Android.mk
Original file line number Diff line number Diff line change
@@ -1,31 +1,46 @@
# Save the local path
SDL_MIXER_LOCAL_PATH := $(call my-dir)

# Enable this if you want to support loading WAV music
SUPPORT_WAV ?= true

# Enable this if you want to support loading FLAC music via dr_flac
SUPPORT_FLAC_DRFLAC ?= true

# Enable this if you want to support loading FLAC music with libFLAC
SUPPORT_FLAC ?= true
FLAC_LIBRARY_PATH := external/flac-1.3.2
SUPPORT_FLAC_LIBFLAC ?= false
FLAC_LIBRARY_PATH := external/flac

# Enable this if you want to support loading OGG Vorbis music via stb_vorbis
SUPPORT_OGG_STB ?= true

# Enable this if you want to support loading OGG Vorbis music via Tremor
SUPPORT_OGG ?= true
OGG_LIBRARY_PATH := external/libogg-1.3.2
VORBIS_LIBRARY_PATH := external/libvorbisidec-1.2.1
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 ?= true
MPG123_LIBRARY_PATH := external/mpg123-1.25.6
SUPPORT_MP3_MPG123 ?= false
MPG123_LIBRARY_PATH := external/mpg123

# Enable this if you want to support loading WavPack music via libwavpack
SUPPORT_WAVPACK ?= true
WAVPACK_LIBRARY_PATH := external/wavpack

# Enable this if you want to support loading MOD music via modplug
SUPPORT_MOD_MODPLUG ?= true
MODPLUG_LIBRARY_PATH := external/libmodplug-0.8.9.0
# Enable this if you want to support loading MOD music via XMP-lite
SUPPORT_MOD_XMP ?= false
XMP_LIBRARY_PATH := external/libxmp

# Enable this if you want to support TiMidity
SUPPORT_MID_TIMIDITY ?= true
TIMIDITY_LIBRARY_PATH := timidity
SUPPORT_MID_TIMIDITY ?= false
TIMIDITY_LIBRARY_PATH := src/codecs/timidity


# Build the library
ifeq ($(SUPPORT_FLAC),true)
ifeq ($(SUPPORT_FLAC_LIBFLAC),true)
include $(SDL_MIXER_LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/Android.mk
endif

Expand All @@ -41,8 +56,13 @@ ifeq ($(SUPPORT_MP3_MPG123),true)
endif

# Build the library
ifeq ($(SUPPORT_MOD_MODPLUG),true)
include $(SDL_MIXER_LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/Android.mk
ifeq ($(SUPPORT_WAVPACK),true)
include $(SDL_MIXER_LOCAL_PATH)/$(WAVPACK_LIBRARY_PATH)/Android.mk
endif

# Build the library
ifeq ($(SUPPORT_MOD_XMP),true)
include $(SDL_MIXER_LOCAL_PATH)/$(XMP_LIBRARY_PATH)/Android.mk
endif

# Build the library
Expand All @@ -58,38 +78,67 @@ include $(CLEAR_VARS)

LOCAL_MODULE := SDL2_mixer

LOCAL_SRC_FILES := $(notdir $(filter-out %/playmus.c %/playwave.c, $(wildcard $(LOCAL_PATH)/*.c))) \
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/src/ \
$(LOCAL_PATH)/src/codecs \


LOCAL_SRC_FILES := \
$(subst $(LOCAL_PATH)/,, \
$(wildcard $(LOCAL_PATH)/src/*.c) \
$(wildcard $(LOCAL_PATH)/src/codecs/*.c) \
)

LOCAL_CFLAGS :=
LOCAL_LDLIBS :=
LOCAL_STATIC_LIBRARIES :=
LOCAL_SHARED_LIBRARIES := SDL2

ifeq ($(SUPPORT_FLAC),true)
ifeq ($(SUPPORT_WAV),true)
LOCAL_CFLAGS += -DMUSIC_WAV
endif

ifeq ($(SUPPORT_FLAC_DRFLAC),true)
LOCAL_CFLAGS += -DMUSIC_FLAC_DRFLAC
endif

ifeq ($(SUPPORT_FLAC_LIBFLAC),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/include
LOCAL_CFLAGS += -DMUSIC_FLAC
LOCAL_CFLAGS += -DMUSIC_FLAC_LIBFLAC
LOCAL_STATIC_LIBRARIES += libFLAC
endif

ifeq ($(SUPPORT_OGG_STB),true)
LOCAL_CFLAGS += -DMUSIC_OGG -DOGG_USE_STB
endif

ifeq ($(SUPPORT_OGG),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(OGG_LIBRARY_PATH)/include
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)
LOCAL_CFLAGS += -DMUSIC_OGG -DOGG_USE_TREMOR -DOGG_HEADER="<ivorbisfile.h>"
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)
LOCAL_CFLAGS += -DMUSIC_MP3_MPG123
LOCAL_SHARED_LIBRARIES += mpg123
endif

ifeq ($(SUPPORT_MOD_MODPLUG),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src/libmodplug
LOCAL_CFLAGS += -DMUSIC_MOD_MODPLUG -DMODPLUG_HEADER="<modplug.h>"
LOCAL_STATIC_LIBRARIES += modplug
ifeq ($(SUPPORT_WAVPACK),true)
LOCAL_CFLAGS += -DMUSIC_WAVPACK -DMUSIC_WAVPACK_DSD -DWAVPACK_HEADER=\"../external/wavpack/include/wavpack.h\"
LOCAL_STATIC_LIBRARIES += wavpack
endif

ifeq ($(SUPPORT_MOD_XMP),true)
LOCAL_CFLAGS += -DMUSIC_MOD_XMP -DLIBXMP_HEADER=\"../external/libxmp/include/xmp.h\"
LOCAL_STATIC_LIBRARIES += xmp
endif

ifeq ($(SUPPORT_MID_TIMIDITY),true)
Expand All @@ -98,6 +147,22 @@ ifeq ($(SUPPORT_MID_TIMIDITY),true)
LOCAL_STATIC_LIBRARIES += timidity
endif

LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/include

include $(BUILD_SHARED_LIBRARY)

###########################
#
# SDL2_mixer static library
#
###########################

LOCAL_MODULE := SDL2_mixer_static

LOCAL_MODULE_FILENAME := libSDL2_mixer

LOCAL_LDLIBS :=
LOCAL_EXPORT_LDLIBS :=

include $(BUILD_STATIC_LIBRARY)

63 changes: 63 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,66 @@
2.8.0:
* Added support for loading wavpack sound files (https://www.wavpack.com/)
* Added support for loading classic console sound files using Game_Music_Emu (https://github.com/libgme/game-music-emu)
* Use minimp3 instead of dr_mp3 as the default backend for MP3 music
* Use libxmp instead of modplug as the default backend for MOD music
To use libmodplug instead, configure using --enable-music-mod-modplug --disable-music-mod-xmp
* Added support for FLAC audio in Ogg containers
* Added Mix_PauseAudio() to pause and resume all audio playback
* Added Mix_GetNumTracks() and Mix_StartTrack() for managing tracks in GME files

2.6.2:
* Updated autotools to use ax_compute_relative_paths, fixing homebrew on macOS

2.6.1:
* Fixed issue with incorrect version reported by pkg-config

2.6.0:
* Added support for building with CMake
* Added support for playing Ogg files using stb_vorbis, which is now the default Vorbis backend.
To use libvorbis instead, configure using --disable-music-ogg-stb --enable-music-ogg-vorbis
* Added support for playing FLAC files using dr_flac, which is now the default FLAC music backend.
To use libflac instead, configure using --disable-music-flac-drflac --enable-music-flac-libflac
* Added support for playing MP3 files using dr_mp3, which is now the default MP3 music backend.
To use libmpg123 instead, configure using --disable-music-mp3-drmp3 --enable-music-mp3-mpg123
* Added libxmp support for mod music playback. Modplug is still the default backend for MOD music.
To use libxmp instead, configure using --disable-music-mod-modplug --enable-music-mod-xmp
* Removed support for libmad as a MP3 music backend.
* Removed support for libmikmod as a MOD music backend.
* Added Mix_MasterVolume() for additional volume control over all channels
* Update Mix_Init() return value to match documentation, including MIXER_INIT_* flags for already-initialized modules
* Added Mix_HasMusicDecoder()
* Memory leak fixes and F32 format support to fluidsynth player
* Fixed distorted MIDI playback with FluidSynth if sample rate is out of library's limits
* Added Mix_ModMusicJumpToOrder() for mod music formats
* Enabled module internal loops in modplug player
* Respect original mp3 file offset
* Support setting soundfont via SDL_SOUNDFONTS in OSX native midi
* Fixed mp3 file detection
* Fixes to ogg playback on big-endian devices
* Added functions to get metadata information:
Mix_GetMusicTitle()
Mix_GetMusicTitleTag()
Mix_GetMusicArtistTag()
Mix_GetMusicAlbumTag()
Mix_GetMusicCopyrightTag()
* Add functions to get loop point information:
Mix_GetMusicLoopStartTime()
Mix_GetMusicLoopEndTime()
Mix_GetMusicLoopLengthTime()
* Added Mix_GetMusicVolume() and Mix_GetMusicPosition()
* Added Mix_MusicDuration() to return music duration in seconds
* Fixed music_mpg123 seek bug when sample rate of the file and the stream don't match
* Timidity improvements, added Mix_SetTimidityCfg()
* Improved mp3 tag detection/skipping
* Extended support for WAV files
* Allow rmid files be opened by native midi
* Fixed possible crash in win32 native midi
* Prevent clipping due to volume settings in modplug music
* Added looping support for Opus files
* Added looping support for FLAC files
* Improved OGG looping support
* Fixed loading Opus audio as audio chunks

2.0.4:
Ozkan Sezer - Wed, 10 Oct 2018 14:56:10
* Removed smpeg support for mp3 music, now that it's replaced by libmpg123
Expand Down
Loading
Loading