[Asterisk-code-review] chan console: don't read and write at the same time (asterisk[15])
George Joseph
asteriskteam at digium.com
Fri Feb 9 11:17:58 CST 2018
George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/8173 )
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; Approved for Submit
diff --git a/channels/chan_console.c b/channels/chan_console.c
index 7c57ec4..7692b26 100644
--- a/channels/chan_console.c
+++ b/channels/chan_console.c
@@ -278,7 +278,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) {
@@ -611,7 +613,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/8173
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I635eacee45f5413faa18f5a3b606af03b926dacb
Gerrit-Change-Number: 8173
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/fa80e689/attachment.html>
More information about the asterisk-code-review
mailing list