[Asterisk-code-review] chan console: don't read and write at the same time (asterisk[master])
Jenkins2
asteriskteam at digium.com
Fri Feb 9 09:31:17 CST 2018
Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/7657 )
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:
Richard Mudgett: Looks good to me, but someone else must approve
Kevin Harwell: 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 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/7657
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I635eacee45f5413faa18f5a3b606af03b926dacb
Gerrit-Change-Number: 7657
Gerrit-PatchSet: 2
Gerrit-Owner: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matthew Fredrickson <creslin at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180209/7ec9fab9/attachment.html>
More information about the asterisk-code-review
mailing list