diff --git a/Makefile b/Makefile index 558392ea18..66d899b65b 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ include config.mk TARGET = ssnes tools/ssnes-joyconfig -OBJ = ssnes.o file.o driver.o settings.o dynamic.o message.o rewind.o movie.o autosave.o gfx/gfx_common.o ups.o bps.o strl.o screenshot.o thread.o +OBJ = ssnes.o file.o driver.o settings.o dynamic.o message.o rewind.o movie.o autosave.o gfx/gfx_common.o ups.o bps.o strl.o screenshot.o thread.o audio/hermite.o JOYCONFIG_OBJ = tools/ssnes-joyconfig.o conf/config_file.o strl.o HEADERS = $(wildcard */*.h) $(wildcard *.h) @@ -27,13 +27,6 @@ ifneq ($(findstring Linux,$(OS)),) LIBS += -lrt endif -ifeq ($(HAVE_SRC), 1) - LIBS += $(SRC_LIBS) - DEFINES += $(SRC_CFLAGS) -else - OBJ += audio/hermite.o -endif - ifeq ($(HAVE_CONFIGFILE), 1) OBJ += conf/config_file.o endif diff --git a/config.def.h b/config.def.h index 3b80dc180c..4306c00caa 100644 --- a/config.def.h +++ b/config.def.h @@ -32,10 +32,6 @@ #include "input/keysym.h" -#ifdef HAVE_SRC -#include -#endif - ///////////////// Drivers #define VIDEO_GL 0 #define VIDEO_XVIDEO 11 @@ -188,11 +184,6 @@ static const int out_latency = 64; // Will sync audio. (recommended) static const bool audio_sync = true; -// Defines the quality (and cpu reqirements) of samplerate conversion. -#ifdef HAVE_SRC -#define SAMPLERATE_QUALITY SRC_LINEAR -#endif - // Enables use of rewind. This will incur some memory footprint depending on the save state buffer. // This rewind only works when using bSNES core atm. static const bool rewind_enable = false; diff --git a/config.features.h b/config.features.h index 3fc2f60826..dd5653491b 100644 --- a/config.features.h +++ b/config.features.h @@ -116,12 +116,6 @@ static const bool _x264rgb_supp = true; static const bool _x264rgb_supp = false; #endif -#ifdef HAVE_SRC -static const bool _src_supp = true; -#else -static const bool _src_supp = false; -#endif - #ifdef HAVE_CONFIGFILE static const bool _configfile_supp = true; #else diff --git a/driver.c b/driver.c index 55af0f24bf..65e2b32a58 100644 --- a/driver.c +++ b/driver.c @@ -237,7 +237,7 @@ void init_audio(void) g_extern.audio_data.nonblock_chunk_size = AUDIO_CHUNK_SIZE_NONBLOCKING; driver.audio_data = driver.audio->init(strlen(g_settings.audio.device) ? g_settings.audio.device : NULL, g_settings.audio.out_rate, g_settings.audio.latency); - if ( driver.audio_data == NULL ) + if (!driver.audio_data) g_extern.audio_active = false; if (g_extern.audio_active && driver.audio->use_float && driver.audio->use_float(driver.audio_data)) @@ -251,16 +251,9 @@ void init_audio(void) else g_extern.audio_data.chunk_size = g_extern.audio_data.block_chunk_size; -#ifdef HAVE_SRC - int err; - g_extern.audio_data.source = src_new(g_settings.audio.src_quality, 2, &err); - if (!g_extern.audio_data.source) - g_extern.audio_active = false; -#else g_extern.audio_data.source = hermite_new(2); if (!g_extern.audio_data.source) g_extern.audio_active = false; -#endif size_t max_bufsamples = g_extern.audio_data.block_chunk_size > g_extern.audio_data.nonblock_chunk_size ? g_extern.audio_data.block_chunk_size : g_extern.audio_data.nonblock_chunk_size; @@ -282,17 +275,11 @@ void uninit_audio(void) return; } - if ( driver.audio_data && driver.audio ) + if (driver.audio_data && driver.audio) driver.audio->free(driver.audio_data); - if ( g_extern.audio_data.source ) - { -#ifdef HAVE_SRC - src_delete(g_extern.audio_data.source); -#else + if (g_extern.audio_data.source) hermite_free(g_extern.audio_data.source); -#endif - } free(g_extern.audio_data.data); g_extern.audio_data.data = NULL; free(g_extern.audio_data.outsamples); g_extern.audio_data.outsamples = NULL; diff --git a/general.h b/general.h index bd04f9fd33..6a91739553 100644 --- a/general.h +++ b/general.h @@ -36,11 +36,7 @@ #include "config.h" #endif -#ifdef HAVE_SRC -#include -#else #include "audio/hermite.h" -#endif #ifndef _WIN32 #include // MAXPATHLEN @@ -121,7 +117,6 @@ struct settings char device[MAXPATHLEN]; unsigned latency; bool sync; - int src_quality; char dsp_plugin[MAXPATHLEN]; char external_driver[MAXPATHLEN]; @@ -210,11 +205,7 @@ struct global struct { -#ifdef HAVE_SRC - SRC_STATE *source; -#else hermite_resampler_t *source; -#endif float *data; size_t data_ptr; diff --git a/qb/config.libs.sh b/qb/config.libs.sh index ed89bf2735..22dcf20883 100644 --- a/qb/config.libs.sh +++ b/qb/config.libs.sh @@ -82,8 +82,6 @@ if [ $HAVE_FFMPEG = yes ]; then check_lib FFMPEG_AVFORMAT_WRITE_HEADER "$AVFORMAT_LIBS" avformat_write_header fi -check_pkgconf SRC samplerate - check_lib DYNAMIC $DYLIB dlopen check_pkgconf FREETYPE freetype2 @@ -96,7 +94,7 @@ check_pkgconf PYTHON python3 add_define_make OS $OS # Creates config.mk and config.h. -VARS="ALSA OSS OSS_BSD OSS_LIB AL RSOUND ROAR JACK COREAUDIO PULSE SDL DYLIB CG XML SDL_IMAGE DYNAMIC FFMPEG AVCODEC AVFORMAT AVUTIL SWSCALE SRC CONFIGFILE FREETYPE XVIDEO NETPLAY FBO STRL PYTHON FFMPEG_ALLOC_CONTEXT3 FFMPEG_AVCODEC_OPEN2 FFMPEG_AVIO_OPEN FFMPEG_AVFORMAT_WRITE_HEADER X264RGB" +VARS="ALSA OSS OSS_BSD OSS_LIB AL RSOUND ROAR JACK COREAUDIO PULSE SDL DYLIB CG XML SDL_IMAGE DYNAMIC FFMPEG AVCODEC AVFORMAT AVUTIL SWSCALE CONFIGFILE FREETYPE XVIDEO NETPLAY FBO STRL PYTHON FFMPEG_ALLOC_CONTEXT3 FFMPEG_AVCODEC_OPEN2 FFMPEG_AVIO_OPEN FFMPEG_AVFORMAT_WRITE_HEADER X264RGB" create_config_make config.mk $VARS create_config_header config.h $VARS diff --git a/qb/config.params.sh b/qb/config.params.sh index e31577c11a..1cf7c49266 100644 --- a/qb/config.params.sh +++ b/qb/config.params.sh @@ -13,7 +13,6 @@ add_command_line_enable FFMPEG "Enable FFmpeg recording support" no add_command_line_enable X264RGB "Enable lossless X264 RGB recording" no add_command_line_enable DYLIB "Enable dynamic loading support" auto add_command_line_enable NETPLAY "Enable netplay support" auto -add_command_line_enable SRC "Enable libsamplerate support" no add_command_line_enable CONFIGFILE "Disable support for config file" yes add_command_line_enable CG "Enable Cg shader support" auto add_command_line_enable XML "Enable bSNES-style XML shader support" auto diff --git a/settings.c b/settings.c index 8d1bd4b0ff..ec1b73e31e 100644 --- a/settings.c +++ b/settings.c @@ -161,10 +161,6 @@ static void set_defaults(void) g_settings.audio.latency = out_latency; g_settings.audio.sync = audio_sync; -#ifdef HAVE_SRC - g_settings.audio.src_quality = SAMPLERATE_QUALITY; -#endif - g_settings.rewind_enable = rewind_enable; g_settings.rewind_buffer_size = rewind_buffer_size; g_settings.rewind_granularity = rewind_granularity; @@ -384,17 +380,6 @@ static void parse_config_file(void) CONFIG_GET_INT(audio.latency, "audio_latency"); CONFIG_GET_BOOL(audio.sync, "audio_sync"); -#ifdef HAVE_SRC - if (config_get_int(conf, "audio_src_quality", &tmp_int)) - { - int quals[] = { SRC_ZERO_ORDER_HOLD, SRC_LINEAR, SRC_SINC_FASTEST, - SRC_SINC_MEDIUM_QUALITY, SRC_SINC_BEST_QUALITY }; - - if (tmp_int > 0 && tmp_int < 6) - g_settings.audio.src_quality = quals[tmp_int]; - } -#endif - CONFIG_GET_STRING(video.driver, "video_driver"); CONFIG_GET_STRING(audio.driver, "audio_driver"); CONFIG_GET_STRING(audio.dsp_plugin, "audio_dsp_plugin"); diff --git a/ssnes.c b/ssnes.c index 6689f219e0..e3e2461abd 100644 --- a/ssnes.c +++ b/ssnes.c @@ -37,9 +37,6 @@ #include "screenshot.h" #include "cheats.h" #include -#ifdef HAVE_SRC -#include -#endif #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN @@ -234,11 +231,7 @@ static void audio_sample(uint16_t left, uint16_t right) if (g_extern.frame_is_reverse) // Disable fucked up audio when rewinding... memset(g_extern.audio_data.data, 0, g_extern.audio_data.chunk_size * sizeof(float)); -#ifdef HAVE_SRC - SRC_DATA src_data = { -#else struct hermite_data src_data = { -#endif .data_in = dsp_output.samples ? dsp_output.samples : g_extern.audio_data.data, .data_out = g_extern.audio_data.outsamples, .input_frames = dsp_output.samples ? dsp_output.frames : (g_extern.audio_data.data_ptr / 2), @@ -249,11 +242,7 @@ static void audio_sample(uint16_t left, uint16_t right) if (dsp_output.should_resample) { -#ifdef HAVE_SRC - src_process(g_extern.audio_data.source, &src_data); -#else hermite_process(g_extern.audio_data.source, &src_data); -#endif output_data = g_extern.audio_data.outsamples; output_frames = src_data.output_frames_gen; @@ -362,7 +351,6 @@ static void print_features(void) _PSUPP(dynamic, "Dynamic", "Dynamic run-time loading of libsnes library"); _PSUPP(ffmpeg, "FFmpeg", "On-the-fly recording of gameplay with libavcodec"); _PSUPP(x264rgb, "x264 RGB", "x264 lossless RGB recording for FFmpeg"); - _PSUPP(src, "SRC", "libsamplerate audio resampling"); _PSUPP(configfile, "Config file", "Configuration file support"); _PSUPP(freetype, "FreeType", "TTF font rendering with FreeType"); _PSUPP(netplay, "Netplay", "Peer-to-peer netplay");