From b05f8290f65ac62b38c7a7d8395f00b032597f3b Mon Sep 17 00:00:00 2001 From: karl Date: Thu, 10 Aug 2023 23:22:36 +0200 Subject: [PATCH] fix bug in default input mechanism #518 --- config.c | 6 +++--- example_files/config | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config.c b/config.c index 410b449a..d002ccae 100644 --- a/config.c +++ b/config.c @@ -45,7 +45,7 @@ const char *default_shader_name[NUMBER_OF_SHADERS] = {"northern_lights.frag", "p double smoothDef[5] = {1, 1, 1, 1, 1}; enum input_method default_methods[] = { - INPUT_FIFO, INPUT_PORTAUDIO, INPUT_ALSA, INPUT_PULSE, INPUT_WINSCAP, + INPUT_FIFO, INPUT_PORTAUDIO, INPUT_ALSA, INPUT_PIPEWIRE, INPUT_PULSE, INPUT_WINSCAP, }; char *outputMethod, *orientation, *channels, *xaxisScale, *monoOption, *fragmentShader, @@ -674,11 +674,11 @@ bool load_config(char configPath[PATH_MAX], struct config_params *p, bool colors free(p->audio_source); - int default_input = -1; + enum input_method default_input = INPUT_FIFO; for (size_t i = 0; i < ARRAY_SIZE(default_methods); i++) { enum input_method method = default_methods[i]; if (has_input_method[method]) { - default_input++; + default_input = default_methods[i]; } } char *input_method_name = diff --git a/example_files/config b/example_files/config index 89b7710e..92fb76f1 100644 --- a/example_files/config +++ b/example_files/config @@ -54,6 +54,7 @@ # Audio capturing method. Possible methods are: 'pulse', 'alsa', 'fifo', 'sndio' or 'shmem' # Defaults to 'pulse', 'pipewire', 'alsa' or 'fifo', in that order, dependent on what support cava was built with. +# On Mac it defaults to 'portaudio' or 'fifo' # On windows this is automatic and no input settings are needed. # # All input methods uses the same config variable 'source'