From 2c62a10d6c79cf49f852a9696866cc838c8c1772 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 30 Jun 2020 18:08:49 +0200 Subject: [PATCH] - Fix codepaths for compiling without HAVE_RWAV - Add back HAVE_BSV_MOVIE --- Makefile.common | 4 ++ Makefile.griffin | 10 +++-- Makefile.msvc | 1 + libretro-common/audio/audio_mix.c | 12 +++++ libretro-common/audio/audio_mixer.c | 8 ++++ managers/state_manager.c | 2 + qb/config.params.sh | 1 + retroarch.c | 68 ++++++++++++++++++++++++++--- tasks/task_audio_mixer.c | 12 ++++- 9 files changed, 107 insertions(+), 11 deletions(-) diff --git a/Makefile.common b/Makefile.common index 80e3c0e0e1..c0ba4415d0 100644 --- a/Makefile.common +++ b/Makefile.common @@ -294,6 +294,10 @@ ifeq ($(HAVE_AUDIOMIXER), 1) $(LIBRETRO_COMM_DIR)/audio/audio_mixer.o endif +ifeq ($(HAVE_BSV_MOVIE), 1) + DEFINES += -DHAVE_BSV_MOVIE +endif + ifeq ($(HAVE_RUNAHEAD), 1) DEFINES += -DHAVE_RUNAHEAD endif diff --git a/Makefile.griffin b/Makefile.griffin index 186f95c0b1..6216a6b1cf 100644 --- a/Makefile.griffin +++ b/Makefile.griffin @@ -847,7 +847,7 @@ else ifeq (qnx,$(platform)) LDFLAGS += -g endif - PLATCFLAGS += -DHAVE_SHADERPIPELINE -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_OZONE -DHAVE_CC_RESAMPLER -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_FBO -DHAVE_GL_SYNC -DHAVE_GLSLANG -DHAVE_BUILTINGLSLANG -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_RUNAHEAD -DHAVE_GFX_WIDGETS -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_SPIRV_CROSS -DHAVE_STB_FONT -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_XMB -DRARCH_INTERNAL -DWANT_GLSLANG -DHAVE_XCB -DHAVE_EGL -DHAVE_BB10 -DHAVE_GLSL -DHAVE_AL -DRARCH_MOBILE + PLATCFLAGS += -DHAVE_SHADERPIPELINE -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_OZONE -DHAVE_CC_RESAMPLER -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_FBO -DHAVE_GL_SYNC -DHAVE_GLSLANG -DHAVE_BUILTINGLSLANG -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_RUNAHEAD -DHAVE_GFX_WIDGETS -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_SPIRV_CROSS -DHAVE_STB_FONT -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_XMB -DRARCH_INTERNAL -DWANT_GLSLANG -DHAVE_XCB -DHAVE_EGL -DHAVE_BB10 -DHAVE_GLSL -DHAVE_AL -DHAVE_BSV_MOVIE -DRARCH_MOBILE EXT_TARGET := $(TARGET_NAME) EXT_INTER_TARGET := $(TARGET_NAME) INCLUDE += -Ilibretro-common/include -Igfx/include -Ideps -Ideps/stb -Ideps/rcheevos/include -Ideps/SPIRV-Cross -Ideps/glslang -I. @@ -881,7 +881,7 @@ else ifneq (,$(findstring unix,$(platform))) HAVE_CONFIGFILE := 1 HAVE_PATCH := 1 - PLATCFLAGS += -D__MMX__ -D__SSE__ -DHAVE_OPENGL -DHAVE_OPENGL1 -DHAVE_GLSL -DHAVE_SHADERPIPELINE -DHAVE_OZONE -DHAVE_CC_RESAMPLER -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_FBO -DHAVE_GL_SYNC -DHAVE_SLANG -DHAVE_GLSLANG -DHAVE_BUILTINGLSLANG -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_RUNAHEAD -DHAVE_GFX_WIDGETS -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_SPIRV_CROSS -DHAVE_STB_FONT -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_VULKAN -DHAVE_XMB -DRARCH_INTERNAL -DWANT_GLSLANG -DHAVE_X11 -DHAVE_XCB -DHAVE_UDEV -DHAVE_PULSE + PLATCFLAGS += -D__MMX__ -D__SSE__ -DHAVE_OPENGL -DHAVE_OPENGL1 -DHAVE_GLSL -DHAVE_SHADERPIPELINE -DHAVE_OZONE -DHAVE_CC_RESAMPLER -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_FBO -DHAVE_GL_SYNC -DHAVE_SLANG -DHAVE_GLSLANG -DHAVE_BUILTINGLSLANG -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_RUNAHEAD -DHAVE_GFX_WIDGETS -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_SPIRV_CROSS -DHAVE_STB_FONT -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_VULKAN -DHAVE_XMB -DRARCH_INTERNAL -DWANT_GLSLANG -DHAVE_X11 -DHAVE_XCB -DHAVE_UDEV -DHAVE_BSV_MOVIE -DHAVE_PULSE EXT_TARGET := $(TARGET_NAME) EXT_INTER_TARGET := $(TARGET_NAME) INCLUDE += -Ilibretro-common/include -Igfx/include -Ideps -Ideps/stb -Ideps/rcheevos/include -Ideps/SPIRV-Cross -Ideps/glslang -I. @@ -898,7 +898,7 @@ else ifeq (dos,$(platform)) HAVE_NETPLAYDISCOVERY := 0 HAVE_OVERLAY := 1 HAVE_VIDEO_LAYOUT := 0 - HAVE_MATERIALUI := 1 + HAVE_MATERIALUI := 0 HAVE_XMB := 0 HAVE_STB_FONT := 1 HAVE_THREADS := 0 @@ -1013,6 +1013,10 @@ ifeq ($(HAVE_IMAGEVIEWER), 1) CFLAGS += -DHAVE_IMAGEVIEWER endif +ifeq ($(HAVE_BSV_MOVIE), 1) + CFLAGS += -DHAVE_BSV_MOVIE +endif + ifeq ($(HAVE_RUNAHEAD), 1) CFLAGS += -DHAVE_RUNAHEAD endif diff --git a/Makefile.msvc b/Makefile.msvc index 00c29f481e..56dcae4378 100644 --- a/Makefile.msvc +++ b/Makefile.msvc @@ -61,6 +61,7 @@ HAVE_LANGEXTRA := 1 HAVE_CHEEVOS := 1 HAVE_SHADERPIPELINE := 1 HAVE_IMAGEVIEWER := 1 +HAVE_BSV_MOVIE := 1 ifeq ($(HAVE_D3D8), 1) D3D8_LIBS := -ld3d8 diff --git a/libretro-common/audio/audio_mix.c b/libretro-common/audio/audio_mix.c index c55f7a0b84..74dad087ee 100644 --- a/libretro-common/audio/audio_mix.c +++ b/libretro-common/audio/audio_mix.c @@ -82,12 +82,14 @@ void audio_mix_free_chunk(audio_chunk_t *chunk) if (!chunk) return; +#ifdef HAVE_RWAV if (chunk->rwav && chunk->rwav->samples) { /* rwav_free only frees the samples */ rwav_free(chunk->rwav); free(chunk->rwav); } +#endif if (chunk->buf) free(chunk->buf); @@ -112,6 +114,7 @@ void audio_mix_free_chunk(audio_chunk_t *chunk) audio_chunk_t* audio_mix_load_wav_file(const char *path, int sample_rate) { +#ifdef HAVE_RWAV int sample_size; int64_t len = 0; void *buf = NULL; @@ -273,6 +276,7 @@ audio_chunk_t* audio_mix_load_wav_file(const char *path, int sample_rate) error: audio_mix_free_chunk(chunk); +#endif return NULL; } @@ -281,12 +285,14 @@ size_t audio_mix_get_chunk_num_samples(audio_chunk_t *chunk) if (!chunk) return 0; +#ifdef HAVE_RWAV if (chunk->rwav) { if (chunk->resample) return chunk->resample_len; return chunk->rwav->numsamples; } +#endif /* no other filetypes supported yet */ return 0; @@ -308,6 +314,7 @@ int16_t audio_mix_get_chunk_sample(audio_chunk_t *chunk, if (!chunk) return 0; +#ifdef HAVE_RWAV if (chunk->rwav) { int sample_size = chunk->rwav->bitspersample / 8; @@ -329,6 +336,7 @@ int16_t audio_mix_get_chunk_sample(audio_chunk_t *chunk, return sample_out; } +#endif /* no other filetypes supported yet */ return 0; @@ -339,6 +347,7 @@ int16_t* audio_mix_get_chunk_samples(audio_chunk_t *chunk) if (!chunk) return 0; +#ifdef HAVE_RWAV if (chunk->rwav) { int16_t *sample; @@ -350,6 +359,7 @@ int16_t* audio_mix_get_chunk_samples(audio_chunk_t *chunk) return sample; } +#endif return NULL; } @@ -359,8 +369,10 @@ int audio_mix_get_chunk_num_channels(audio_chunk_t *chunk) if (!chunk) return 0; +#ifdef HAVE_RWAV if (chunk->rwav) return chunk->rwav->numchannels; +#endif /* don't support other formats yet */ return 0; diff --git a/libretro-common/audio/audio_mixer.c b/libretro-common/audio/audio_mixer.c index e4a4cf2ecd..1f07e434a9 100644 --- a/libretro-common/audio/audio_mixer.c +++ b/libretro-common/audio/audio_mixer.c @@ -23,7 +23,9 @@ #include