From 9323a453b09b56f5df6e65f4a5f794d3d5303d00 Mon Sep 17 00:00:00 2001 From: Timothy Schoen Date: Tue, 27 Aug 2024 01:39:51 +0200 Subject: [PATCH 1/3] Fix [sfont~] info crash --- Code_source/Compiled/audio/sfont~/sfont~.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Code_source/Compiled/audio/sfont~/sfont~.c b/Code_source/Compiled/audio/sfont~/sfont~.c index 7567e935b..93b2d16f0 100644 --- a/Code_source/Compiled/audio/sfont~/sfont~.c +++ b/Code_source/Compiled/audio/sfont~/sfont~.c @@ -473,7 +473,8 @@ static void sfont_info(t_sfont *x){ post("Loaded soundfont: %s", fluid_sfont_get_name(x->x_sfont)); post("------------------- presets -------------------"); int i = 1; - fluid_preset_t* preset; + fluid_preset_t* preset = fluid_sfont_get_preset(x->x_sfont, 0, 0); + if(!preset) return; fluid_sfont_iteration_start(x->x_sfont); while((fluid_sfont_iteration_next(x->x_sfont, preset))) { int bank = preset->get_banknum(preset), pgm = preset->get_num(preset); From 9583e6b1d882a6546b0926b29c06298adeeea133 Mon Sep 17 00:00:00 2001 From: Timothy Schoen Date: Tue, 27 Aug 2024 01:40:16 +0200 Subject: [PATCH 2/3] Fix universal binary compilation for [play.file~] --- .../Compiled/audio/play.file~/Makefile | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/Code_source/Compiled/audio/play.file~/Makefile b/Code_source/Compiled/audio/play.file~/Makefile index 4b743d746..607d72c07 100644 --- a/Code_source/Compiled/audio/play.file~/Makefile +++ b/Code_source/Compiled/audio/play.file~/Makefile @@ -10,6 +10,16 @@ lib.name = play.file~ define forDarwin cflags += -mmacosx-version-min=10.9 + ffmpeg_config = --extra-cflags=-mmacosx-version-min=10.9 --extra-ldflags=-mmacosx-version-min=10.9 + ffmpeg_cc="clang -arch x86_64 -arch arm64" +endef + +define forLinux +ffmpeg_config = --enable-pic +endef + +define forWindows +ldlibs += -lbcrypt endef LIBSAMPLERATE=../../../shared/libsamplerate @@ -25,20 +35,6 @@ ifeq ($(extension),d_arm64) override arch := arm64 endif -define forLinux -# ASM causes static linker issues on Linux -ffmpeg_config = --enable-pic --disable-asm -endef - -define forWindows -ffmpeg_config = --disable-x86asm -ldlibs += -lbcrypt -endef - -define forDarwin - ffmpeg_config = --disable-x86asm --extra-cflags=-mmacosx-version-min=10.9 --extra-ldflags=-mmacosx-version-min=10.9 -endef - # Makefile based on pd-lib-builder by Katja Vetter, see: https://github.com/pure-data/pd-lib-builder PDLIBBUILDER_DIR=../../../../pd-lib-builder/ include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder @@ -50,9 +46,10 @@ all_obj: ffmpeg play.file~ sfload ffmpeg: $(FFMPEG_DIR) $(FFMPEG_DIR): + rm -rf $(FFMPEG_DIR) tar xjf $(FFMPEG_TAR) - cd $(FFMPEG_DIR) && ./configure --enable-static --disable-shared --enable-optimizations --disable-debug --disable-doc --disable-programs --disable-iconv --disable-avdevice --disable-postproc --disable-network --disable-everything --enable-avcodec --enable-avformat --enable-avutil --enable-swscale --enable-swresample --enable-decoder=mp3*,pcm*,aac*,flac,vorbis,opus --enable-parser=mpegaudio,aac --enable-demuxer=mp3,wav,aiff,flac,aac,ogg,pcm* --enable-filter=aresample --enable-protocol=file $(ffmpeg_config) - cd $(FFMPEG_DIR) && make + cd $(FFMPEG_DIR) && ./configure --disable-asm --enable-static --disable-shared --enable-optimizations --disable-debug --disable-doc --disable-programs --disable-iconv --disable-avdevice --disable-postproc --disable-network --disable-everything --enable-avcodec --enable-avformat --enable-avutil --enable-swscale --enable-swresample --enable-decoder=mp3*,pcm*,aac*,flac,vorbis,opus --enable-parser=mpegaudio,aac --enable-demuxer=mp3,wav,aiff,flac,aac,ogg,pcm* --enable-filter=aresample --enable-protocol=file $(ffmpeg_config) + cd $(FFMPEG_DIR) && make CC=$(ffmpeg_cc) clean: rm -rf $(FFMPEG_DIR) From 321bea127bdad05ad0c6378624168605012d9035 Mon Sep 17 00:00:00 2001 From: Timothy Schoen Date: Tue, 27 Aug 2024 01:49:15 +0200 Subject: [PATCH 3/3] Fix compilation on other platforms --- Code_source/Compiled/audio/play.file~/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Code_source/Compiled/audio/play.file~/Makefile b/Code_source/Compiled/audio/play.file~/Makefile index 607d72c07..25ba9ae30 100644 --- a/Code_source/Compiled/audio/play.file~/Makefile +++ b/Code_source/Compiled/audio/play.file~/Makefile @@ -15,11 +15,13 @@ define forDarwin endef define forLinux -ffmpeg_config = --enable-pic + ffmpeg_config = --enable-pic + ffmpeg_cc="$(CC)" endef define forWindows -ldlibs += -lbcrypt + ldlibs += -lbcrypt + ffmpeg_cc="$(CC)" endef LIBSAMPLERATE=../../../shared/libsamplerate