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