From e96b8263341a773f32e8a5c3e932d740ae4aff7b Mon Sep 17 00:00:00 2001
From: John Melton G0ORX <john.d.melton@googlemail.com>
Date: Tue, 17 Mar 2020 11:53:30 +0000
Subject: [PATCH] Fixed typo in old_protocol.c. Changed bas sample rate for
 RTLSDR.

---
 old_protocol.c    | 2 +-
 soapy_discovery.c | 4 ++--
 soapy_protocol.c  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/old_protocol.c b/old_protocol.c
index d030dd2..2d9e6ab 100644
--- a/old_protocol.c
+++ b/old_protocol.c
@@ -864,7 +864,7 @@ static void process_ozy_input_buffer(unsigned char  *buffer) {
         }
         break;
       case 1:
-        if (device != DEVICE_HERMES_LITE_2) {
+        if (device != DEVICE_HERMES_LITE2) {
 	  //
 	  // HL2 uses C1/C2 for measuring the temperature
 	  //
diff --git a/soapy_discovery.c b/soapy_discovery.c
index a9cfcf1..330644d 100644
--- a/soapy_discovery.c
+++ b/soapy_discovery.c
@@ -123,9 +123,9 @@ static void get_info(char *driver) {
   } else if(strcmp(driver,"plutosdr")==0) {
     sample_rate=768000;
   } else if(strcmp(driver,"rtlsdr")==0) {
-    sample_rate=1024000;
+    sample_rate=1048576;
   } else {
-    sample_rate=1024000;
+    sample_rate=1048576;
   }
 
   fprintf(stderr,"sample_rate selected %d\n",sample_rate);
diff --git a/soapy_protocol.c b/soapy_protocol.c
index f266132..3b67dfb 100644
--- a/soapy_protocol.c
+++ b/soapy_protocol.c
@@ -311,16 +311,16 @@ static void *receive_thread(void *arg) {
 fprintf(stderr,"soapy_protocol: receive_thread\n");
   while(running) {
     elements=SoapySDRDevice_readStream(soapy_device,rx_stream,buffs,max_samples,&flags,&timeNs,timeoutUs);
+    //fprintf(stderr,"soapy_protocol_receive_thread: SoapySDRDevice_readStream failed: max_samples=%d read=%d\n",max_samples,elements);
     if(elements<0) {
-      fprintf(stderr,"soapy_protocol_receive_thread: SoapySDRDevice_readStream failed: %s max_samples=%d read=%d\n",SoapySDR_errToStr(elements),max_samples,elements);
       continue;
     }
+    
     for(i=0;i<elements;i++) {
       rx->buffer[i*2]=(double)buffer[i*2];
       rx->buffer[(i*2)+1]=(double)buffer[(i*2)+1];
     }
 
-
     if(rx->resampler!=NULL) {
       int samples=xresample(rx->resampler);
       for(i=0;i<samples;i++) {
-- 
2.45.2