]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
When changing the sample rate for the
authorDL1YCF <dl1ycf@darc.de>
Tue, 18 May 2021 13:48:24 +0000 (15:48 +0200)
committerDL1YCF <dl1ycf@darc.de>
Tue, 18 May 2021 13:48:24 +0000 (15:48 +0200)
PS_FEEDBACK receiver, quickly return in
any case.

receiver.c

index c83d70f0daab2bafea67c3195fec12869e5f8e92..96cdac1ee4b4a1706ec2f6d3bc8e6c1bc7c0e86e 100644 (file)
@@ -928,7 +928,7 @@ g_print("%s: id=%d buffer_size=%d\n",__FUNCTION__,id,buffer_size);
   rx->agc_slope=35.0;
   rx->agc_hang_threshold=0.0;
   
-#if defined(ALSAAUDIO) || defined(PORTAUDIO)
+#if defined(ALSA) || defined(PORTAUDIO)
   rx->playback_handle=NULL;
 #endif
 #ifdef PULSEAUDIO
@@ -1233,24 +1233,24 @@ void receiver_change_sample_rate(RECEIVER *rx,int sample_rate) {
 
 g_print("%s: id=%d rate=%d scale=%d buffer_size=%d output_samples=%d\n",__FUNCTION__,rx->id,sample_rate,scale,rx->buffer_size,rx->output_samples);
 #ifdef PURESIGNAL
-  if(can_transmit && transmitter->puresignal) {
   if (rx->id == PS_RX_FEEDBACK) {
-    if (protocol == ORIGINAL_PROTOCOL) {
-      rx->pixels = 2* scale * rx->width;
-    } else {
-      // We should never arrive here, since the sample rate of the
-      // PS feedback receiver is fixed.
-      rx->pixels = 8 * rx->width;
+    if (canTransmit) {
+      if (protocol == ORIGINAL_PROTOCOL) {
+        rx->pixels = 2* scale * rx->width;
+      } else {
+        // We should never arrive here, since the sample rate of the
+        // PS feedback receiver is fixed.
+        rx->pixels = 8 * rx->width;
+      }
+      g_free(rx->pixel_samples);
+      rx->pixel_samples=g_new(float,rx->pixels);
+      init_analyzer(rx);
+      g_print("%s: PS FEEDBACK: id=%d rate=%d buffer_size=%d output_samples=%d\n",
+                     __FUNCTION__,rx->id, rx->sample_rate, rx->buffer_size, rx->output_samples);
     }
-    g_free(rx->pixel_samples);
-    rx->pixel_samples=g_new(float,rx->pixels);
-    init_analyzer(rx);
-    g_print("%s: PS FEEDBACK: id=%d rate=%d buffer_size=%d output_samples=%d\n",
-                   __FUNCTION__,rx->id, rx->sample_rate, rx->buffer_size, rx->output_samples);
     g_mutex_unlock(&rx->mutex);
     return;
   }
-  }
 #endif
   //
   // re-calculate AGC line for panadapter since it depends on sample rate