Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pjmedia/src/pjmedia/sound_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,8 @@ PJ_DEF(pj_status_t) pjmedia_snd_port_set_ec( pjmedia_snd_port *snd_port,
}

} else {
pj_bool_t restart_stream = PJ_FALSE;

/* We use software EC */

/* Check if there is change in parameters */
Expand All @@ -773,6 +775,10 @@ PJ_DEF(pj_status_t) pjmedia_snd_port_set_ec( pjmedia_snd_port *snd_port,

/* Destroy AEC */
if (snd_port->ec_state) {
/* Stop the stream first to prevent race condition. */
restart_stream = PJ_TRUE;
pjmedia_aud_stream_stop(snd_port->aud_stream);

pjmedia_echo_destroy(snd_port->ec_state);
snd_port->ec_state = NULL;
}
Expand Down Expand Up @@ -805,6 +811,9 @@ PJ_DEF(pj_status_t) pjmedia_snd_port_set_ec( pjmedia_snd_port *snd_port,

snd_port->ec_options = options;
snd_port->ec_tail_len = tail_ms;

if (restart_stream)
pjmedia_aud_stream_start(snd_port->aud_stream);
}

return status;
Expand Down
Loading