From: Chris Tallon Date: Sun, 25 Nov 2007 13:25:36 +0000 (+0000) Subject: Bug fix for new stream protocol X-Git-Tag: r0-3-0~27 X-Git-Url: https://git.vomp.tv/gitweb/?a=commitdiff_plain;h=a6764b2a4382a1f658413d5a43784f006b883c6a;p=vompserver.git Bug fix for new stream protocol --- diff --git a/mvpreceiver.c b/mvpreceiver.c index fcc9caf..ae8c01b 100755 --- a/mvpreceiver.c +++ b/mvpreceiver.c @@ -102,14 +102,17 @@ void MVPReceiver::threadMethod() threadWaitForSignal(); threadCheckExit(); - pthread_mutex_lock(&processedRingLock); - amountReceived = processed.get(buffer+12, streamChunkSize); - pthread_mutex_unlock(&processedRingLock); + do + { + pthread_mutex_lock(&processedRingLock); + amountReceived = processed.get(buffer+12, streamChunkSize); + pthread_mutex_unlock(&processedRingLock); - *(ULONG*)&buffer[0] = htonl(2); // stream channel - *(ULONG*)&buffer[4] = htonl(streamID); - *(ULONG*)&buffer[8] = htonl(amountReceived); - tcp->sendPacket(buffer, amountReceived + 12); + *(ULONG*)&buffer[0] = htonl(2); // stream channel + *(ULONG*)&buffer[4] = htonl(streamID); + *(ULONG*)&buffer[8] = htonl(amountReceived); + tcp->sendPacket(buffer, amountReceived + 12); + } while(processed.getContent()); } }