Commit a9b59299 authored by Ghislain MARY's avatar Ghislain MARY

Allow changing sampling rate if different than 8kHz or 16 kHz (choose the bigger valid value).

parent 5e1891a9
......@@ -281,11 +281,13 @@ static void webrtc_aec_postprocess(MSFilter *f)
static int webrtc_aec_set_sr(MSFilter *f, void *arg)
{
WebRTCAECState *s = (WebRTCAECState *) f->data;
int sr=*(int *) arg;
if (sr!=8000 && sr!=16000){
ms_message("Webrtc aec does not support sampling rate %i",sr);
return -1;
int requested_sr = *(int *) arg;
int sr = requested_sr;
if (requested_sr != 8000 && requested_sr != 16000) {
if (requested_sr > 16000) sr = 16000;
else sr = 8000;
ms_message("Webrtc aec does not support sampling rate %i, using %i instead", requested_sr, sr);
}
s->samplerate = sr;
return 0;
......
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