Skip to content

Commit

Permalink
fix bug in default input mechanism #518
Browse files Browse the repository at this point in the history
  • Loading branch information
karlstav committed Aug 10, 2023
1 parent 83b4cda commit b05f829
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 =
Expand Down
1 change: 1 addition & 0 deletions example_files/config
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit b05f829

Please sign in to comment.