Commit 320b0b6c authored by François Grisez's avatar François Grisez
Browse files

Use ms_parse_equalizer_string() to parse the strings provided by the gain linphonerc parameter

parent c703de1e
...@@ -2689,15 +2689,16 @@ static void parametrize_equalizer(LinphoneCore *lc, AudioStream *st){ ...@@ -2689,15 +2689,16 @@ static void parametrize_equalizer(LinphoneCore *lc, AudioStream *st){
ms_filter_call_method(f,MS_EQUALIZER_SET_ACTIVE,&enabled); ms_filter_call_method(f,MS_EQUALIZER_SET_ACTIVE,&enabled);
if (enabled){ if (enabled){
if (gains){ if (gains){
do{ MSList *gains_list = ms_parse_equalizer_string(gains);
int bytes; if (gains_list) {
MSEqualizerGain g; MSList *it;
if (sscanf(gains,"%f:%f:%f %n",&g.frequency,&g.gain,&g.width,&bytes)==3){ for(it=gains_list; it; it=it->next) {
ms_message("Read equalizer gains: %f(~%f) --> %f",g.frequency,g.width,g.gain); MSEqualizerGain *g = (MSEqualizerGain *)it->data;
ms_filter_call_method(f,MS_EQUALIZER_SET_GAIN,&g); ms_message("Read equalizer gains: %f(~%f) --> %f",g->frequency,g->width,g->gain);
gains+=bytes; ms_filter_call_method(f,MS_EQUALIZER_SET_GAIN, g);
}else break; }
}while(1); ms_list_free_with_data(gains_list, ms_free);
} }
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment