Skip to content

Commit 192b706

Browse files
committed
afilter/compressor: Accept shortened params
1 parent be954b6 commit 192b706

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎src/audio/filter/compressor.cpp‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,16 @@ bool parse_config(state_audio_compressor *s, std::string_view cfg){
130130
const auto key = tokenize(tok, '=');
131131
const auto val = tokenize(tok, '=');
132132

133-
if (key == "attack"){
133+
using namespace std::literals::string_view_literals;
134+
if ("attack"sv.starts_with(key)){
134135
parse_num(val, s->attack_ms);
135-
} else if(key == "release"){
136+
} else if("release"sv.starts_with(key)){
136137
parse_num(val, s->release_ms);
137-
} else if(key == "threshold"){
138+
} else if("threshold"sv.starts_with(key)){
138139
parse_num(val, s->threshold);
139-
} else if(key == "ratio"){
140+
} else if("ratio"sv.starts_with(key)){
140141
parse_num(val, s->ratio);
141-
} else if(key == "makeup"){
142+
} else if("makeup"sv.starts_with(key)){
142143
parse_num(val, s->makeup_gain);
143144
} else {
144145
log_msg(LOG_LEVEL_FATAL, MOD_NAME "Unknown parameter %s\n", SV_TO_CSTR(key));

0 commit comments

Comments
 (0)