[Asterisk-code-review] chan console: don't read and write at the same time (asterisk[13])
Jenkins2
asteriskteam at digium.com
Fri Feb 9 09:25:36 CST 2018
Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/8174 )
Change subject: chan_console: don't read and write at the same time
......................................................................
chan_console: don't read and write at the same time
It seems that the ALSA backend of PortAudio doesn't know how to both
read and write at the same time by adding a per-device mutex.
FIXME: currently only a draft version. Need to either auto-detect
we work with the ALSA backend or add an extra configuration option
to use this mutex.
ASTERISK-27426 #close
Change-Id: I635eacee45f5413faa18f5a3b606af03b926dacb
---
M channels/chan_console.c
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Jenkins2: Approved for Submit
diff --git a/channels/chan_console.c b/channels/chan_console.c
index bc5f7f2..f09694b 100644
--- a/channels/chan_console.c
+++ b/channels/chan_console.c
@@ -280,7 +280,9 @@
for (;;) {
pthread_testcancel();
+ console_pvt_lock(pvt);
res = Pa_ReadStream(pvt->stream, buf, sizeof(buf) / sizeof(int16_t));
+ console_pvt_unlock(pvt);
pthread_testcancel();
if (!pvt->owner) {
@@ -613,7 +615,9 @@
{
struct console_pvt *pvt = ast_channel_tech_pvt(chan);
+ console_pvt_lock(pvt);
Pa_WriteStream(pvt->stream, f->data.ptr, f->samples);
+ console_pvt_unlock(pvt);
return 0;
}
--
To view, visit https://gerrit.asterisk.org/8174
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I635eacee45f5413faa18f5a3b606af03b926dacb
Gerrit-Change-Number: 8174
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180209/d0ce5d45/attachment-0001.html>
More information about the asterisk-code-review
mailing list