From 513da11267b7634372e634c5029f574836554af8 Mon Sep 17 00:00:00 2001 From: F5OEO Date: Wed, 31 Jan 2018 14:52:56 +0000 Subject: [PATCH] Reading from pipe could read less than request --- src/RpiTx.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/RpiTx.c b/src/RpiTx.c index cf028b9..9bc736b 100644 --- a/src/RpiTx.c +++ b/src/RpiTx.c @@ -1427,20 +1427,23 @@ int pitx_run( if(NbRead!=DmaSampleBurstSize*2*sizeof(float)) { printf("rpitx: NbRead %d/%d\n",NbRead,DmaSampleBurstSize*2*sizeof(float)); - if(loop_mode_flag==1) - { - printf("Looping FileIn\n"); - reset(); - } - else if (!useStdin) { - stop_dma(); - return 0; - } + if(NbRead<=0) + { + if(loop_mode_flag==1) + { + printf("Looping FileIn\n"); + reset(); + } + else if (!useStdin) { + stop_dma(); + return 0; + } + } } - for(i=0;i