From: DL1YCF <dl1ycf@darc.de>
Date: Tue, 1 Jun 2021 15:02:01 +0000 (+0200)
Subject: "block" audio_write() if transmitting in CW
X-Git-Url: https://git.rkrishnan.org/components/vdrive/banana.xhtml?a=commitdiff_plain;h=a6da6ad0fc22d38b87108b47008fe974e9d70a87;p=pihpsdr.git

"block" audio_write() if transmitting in CW
---

diff --git a/pulseaudio.c b/pulseaudio.c
index 3ea4457..59a7449 100644
--- a/pulseaudio.c
+++ b/pulseaudio.c
@@ -10,6 +10,7 @@
 #include "mode.h"
 #include "new_protocol.h"
 #include "old_protocol.h"
+#include "vfo.h"
 #ifdef SOAPYSDR
 #include "soapy_protocol.h"
 #endif
@@ -368,6 +369,11 @@ int audio_write(RECEIVER *rx,float left_sample,float right_sample) {
   int result=0;
   int rc;
   int err;
+  int txmode=get_tx_mode();
+
+  if (rx == active_receiver && isTransmitting() && (txmode==modeCWU || txmode==modeCWL)) {
+    return 0;
+  }
 
   g_mutex_lock(&rx->local_audio_mutex);