提交 667507bd authored 作者: Moises Silva's avatar Moises Silva

mod_portaudio: release the endpoint on hangup

上级 dc98b03b
...@@ -746,13 +746,19 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session) ...@@ -746,13 +746,19 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session)
if (tech_pvt->audio_endpoint) { if (tech_pvt->audio_endpoint) {
audio_endpoint_t *endpoint = tech_pvt->audio_endpoint; audio_endpoint_t *endpoint = tech_pvt->audio_endpoint;
tech_pvt->audio_endpoint = NULL;
switch_mutex_lock(endpoint->mutex); switch_mutex_lock(endpoint->mutex);
release_stream_channel(endpoint->in_stream, endpoint->inchan, 1); release_stream_channel(endpoint->in_stream, endpoint->inchan, 1);
release_stream_channel(endpoint->out_stream, endpoint->outchan, 0); release_stream_channel(endpoint->out_stream, endpoint->outchan, 0);
switch_core_timer_destroy(&endpoint->read_timer); switch_core_timer_destroy(&endpoint->read_timer);
switch_core_timer_destroy(&endpoint->write_timer); switch_core_timer_destroy(&endpoint->write_timer);
switch_core_codec_destroy(&endpoint->read_codec); switch_core_codec_destroy(&endpoint->read_codec);
switch_core_codec_destroy(&endpoint->write_codec); switch_core_codec_destroy(&endpoint->write_codec);
endpoint->master = NULL;
switch_mutex_unlock(endpoint->mutex); switch_mutex_unlock(endpoint->mutex);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论