提交 267d9cbc authored 作者: Moises Silva's avatar Moises Silva

mod_portaudio: few more checks on write

上级 792149f3
...@@ -969,6 +969,15 @@ static switch_status_t channel_endpoint_write(audio_endpoint_t *endpoint, switch ...@@ -969,6 +969,15 @@ static switch_status_t channel_endpoint_write(audio_endpoint_t *endpoint, switch
switch_core_timer_next(&endpoint->write_timer); switch_core_timer_next(&endpoint->write_timer);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
if (!endpoint->master) {
return SWITCH_STATUS_SUCCESS;
}
if (switch_test_flag(endpoint->master, TFLAG_HUP)) {
return SWITCH_STATUS_FALSE;
}
if (!switch_test_flag(endpoint->master, TFLAG_IO)) {
return SWITCH_STATUS_SUCCESS;
}
WriteAudioStream(endpoint->out_stream->stream, (short *)frame->data, WriteAudioStream(endpoint->out_stream->stream, (short *)frame->data,
(int)(frame->datalen / sizeof(SAMPLE)), (int)(frame->datalen / sizeof(SAMPLE)),
endpoint->outchan, &(endpoint->write_timer)); endpoint->outchan, &(endpoint->write_timer));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论