diff --git a/slsReceiverSoftware/src/UDPBaseImplementation.cpp b/slsReceiverSoftware/src/UDPBaseImplementation.cpp index f12890aa2..8b2cdb598 100644 --- a/slsReceiverSoftware/src/UDPBaseImplementation.cpp +++ b/slsReceiverSoftware/src/UDPBaseImplementation.cpp @@ -688,7 +688,7 @@ void UDPBaseImplementation::copyFrameToGui(char* startbuf[], uint32_t fnum, char pthread_mutex_unlock(&dataReadyMutex); } - //random read or nth frame read, gui needs data now + //random read or nth frame read, gui needs data now or it is the first frame else{ /* //nth frame read, block current process if the guireader hasnt read it yet diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index 6f454ab57..55e8775f7 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -874,7 +874,7 @@ void UDPStandardImplementation::readFrame(char* c,char** raw, uint32_t &fnum, ui if (guiData == NULL){ guiData = latestData; #ifdef VERY_VERY_DEBUG - cout <<"gui data not null anymore" << endl; + cout << "gui data not null anymore" << endl; #endif } @@ -886,14 +886,14 @@ void UDPStandardImplementation::readFrame(char* c,char** raw, uint32_t &fnum, ui //could not get gui data if(!guiDataReady){ #ifdef VERY_VERY_DEBUG - cout<<"gui data not ready"<= packetsPerFrame){//min 1 frame, but neednt be + //if(numpackets == packetsPerFrame * numJobsPerThread){ //only full frames copyFrameToGui(NULL,-1,wbuf[0]+HEADER_SIZE_NUM_TOT_PACKETS); #ifdef VERYVERBOSE cout << ithread << " finished copying" << endl; @@ -2108,8 +2117,16 @@ int i; exit(-1); } + //free buffer + if(rc <= 0){ + cout << ithread << "Discarding empty frame" << endl; + fifoFree[ithread]->push(buffer[ithread]); +#ifdef FIFO_DEBUG + cprintf(BLUE,"%d listener empty buffer pushed into fifofree %x\n", ithread, (void*)(buffer[ithread])); +#endif + } //push the last buffer into fifo - if(rc > 0){ + else{ //eiger (incomplete frames) - throw away if((myDetectorType == EIGER) && (rc < (bufferSize * numJobsPerThread)) ){ if(rc == 266240) @@ -2135,14 +2152,6 @@ int i; #endif } } - //free buffer - else{ - cout << ithread << "Discarding empty frame" << endl; - fifoFree[ithread]->push(buffer[ithread]); -#ifdef FIFO_DEBUG - cprintf(BLUE,"%d listener empty buffer pushed into fifofree %x\n", ithread, (void*)(buffer[ithread])); -#endif - } diff --git a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp index 8b0d52195..8c3815c19 100644 --- a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp +++ b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp @@ -1252,10 +1252,10 @@ int slsReceiverTCPIPInterface::gotthard_read_frame(){ } #ifdef VERBOSE - if(arg!=-1){ + //if(arg!=-1){ cout << "fName:" << fName << endl; cout << "findex:" << arg << endl; - } + //} #endif