mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-18 15:49:56 +00:00
Merge "chan_console: don't read and write at the same time"
This commit is contained in:
@@ -278,7 +278,9 @@ static void *stream_monitor(void *data)
|
|||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
pthread_testcancel();
|
pthread_testcancel();
|
||||||
|
console_pvt_lock(pvt);
|
||||||
res = Pa_ReadStream(pvt->stream, buf, sizeof(buf) / sizeof(int16_t));
|
res = Pa_ReadStream(pvt->stream, buf, sizeof(buf) / sizeof(int16_t));
|
||||||
|
console_pvt_unlock(pvt);
|
||||||
pthread_testcancel();
|
pthread_testcancel();
|
||||||
|
|
||||||
if (!pvt->owner) {
|
if (!pvt->owner) {
|
||||||
@@ -611,7 +613,9 @@ static int console_write(struct ast_channel *chan, struct ast_frame *f)
|
|||||||
{
|
{
|
||||||
struct console_pvt *pvt = ast_channel_tech_pvt(chan);
|
struct console_pvt *pvt = ast_channel_tech_pvt(chan);
|
||||||
|
|
||||||
|
console_pvt_lock(pvt);
|
||||||
Pa_WriteStream(pvt->stream, f->data.ptr, f->samples);
|
Pa_WriteStream(pvt->stream, f->data.ptr, f->samples);
|
||||||
|
console_pvt_unlock(pvt);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user