Commit 4ad5b7be authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Notify start of DTMF in the case where there are some input to the filter.

parent 89c64402
...@@ -308,6 +308,12 @@ static void dtmfgen_process(MSFilter *f){ ...@@ -308,6 +308,12 @@ static void dtmfgen_process(MSFilter *f){
} else s->silence=0; } else s->silence=0;
while((m=ms_queue_get(f->inputs[0]))!=NULL){ while((m=ms_queue_get(f->inputs[0]))!=NULL){
if (s->playing && s->silence==0){ if (s->playing && s->silence==0){
if (s->pos==0){
MSDtmfGenEvent ev;
ev.tone_start_time=f->ticker->time;
strncpy(ev.tone_name,s->current_tone.tone_name,sizeof(ev.tone_name));
ms_filter_notify(f,MS_DTMF_GEN_EVENT,&ev);
}
nsamples=(m->b_wptr-m->b_rptr)/(2*s->nchannels); nsamples=(m->b_wptr-m->b_rptr)/(2*s->nchannels);
write_dtmf(s, (int16_t*)m->b_rptr,nsamples); write_dtmf(s, (int16_t*)m->b_rptr,nsamples);
} }
......
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