From 9067d715e6c9a9d0904bf24e81858aa28895819d Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Fri, 13 Jun 2008 16:44:44 +0000 Subject: [PATCH] Removed obselete code --- mvpreceiver.c | 26 -------------------------- mvpreceiver.h | 1 - vompclientrrproc.c | 30 +++++++++--------------------- 3 files changed, 9 insertions(+), 48 deletions(-) diff --git a/mvpreceiver.c b/mvpreceiver.c index 2135e3c..13ae3c8 100755 --- a/mvpreceiver.c +++ b/mvpreceiver.c @@ -154,29 +154,3 @@ void MVPReceiver::sendStreamEnd() tcp->sendPacket(buffer, bufferLength); } -ULONG MVPReceiver::getBlock(unsigned char* buffer, unsigned long amount) -{ -/* - pthread_mutex_lock(&processedRingLock); - - int numTries = 0; - - while ((unsigned long)processed.getContent() < amount) - { - pthread_mutex_unlock(&processedRingLock); - if (++numTries == 30) // 15s - { - logger->log("MVPReceiver", Log::DEBUG, "getBlock timeout"); - return 0; - } - usleep(500000); - pthread_mutex_lock(&processedRingLock); - } - - unsigned long amountReceived = processed.get(buffer, amount); - pthread_mutex_unlock(&processedRingLock); - return amountReceived; - */ - sleep(10); - return 0; -} diff --git a/mvpreceiver.h b/mvpreceiver.h index 7fec441..8b5d872 100755 --- a/mvpreceiver.h +++ b/mvpreceiver.h @@ -37,7 +37,6 @@ class MVPReceiver : public cReceiver, public Thread static MVPReceiver* create(cChannel*, int priority); virtual ~MVPReceiver(); int init(TCP* tcp, ULONG streamID); - ULONG getBlock(unsigned char* buffer, unsigned long amount); bool isVdrActivated(); private: diff --git a/vompclientrrproc.c b/vompclientrrproc.c index de10796..824000f 100644 --- a/vompclientrrproc.c +++ b/vompclientrrproc.c @@ -1033,9 +1033,15 @@ int VompClientRRProc::processStopStreaming() int VompClientRRProc::processGetBlock() { - if (!x.lp && !x.recplayer) + if (x.lp) + { + log->log("RRProc", Log::ERR, "Get block called during live streaming"); + return 0; + } + + if (!x.recplayer) { - log->log("RRProc", Log::DEBUG, "Get block called when no streaming happening!"); + log->log("RRProc", Log::ERR, "Get block called when no recording open"); return 0; } @@ -1048,25 +1054,7 @@ int VompClientRRProc::processGetBlock() log->log("RRProc", Log::DEBUG, "getblock pos = %llu length = %lu", position, amount); UCHAR sendBuffer[amount]; - ULONG amountReceived = 0; // compiler moan. - if (x.lp) - { - log->log("RRProc", Log::DEBUG, "getting from live"); - amountReceived = x.lp->getBlock(&sendBuffer[0], amount); - - if (!amountReceived) - { - // vdr has possibly disconnected the receiver - log->log("RRProc", Log::DEBUG, "VDR has disconnected the live receiver"); - delete x.lp; - x.lp = NULL; - } - } - else if (x.recplayer) - { - log->log("RRProc", Log::DEBUG, "getting from recording"); - amountReceived = x.recplayer->getBlock(&sendBuffer[0], position, amount); - } + ULONG amountReceived = x.recplayer->getBlock(&sendBuffer[0], position, amount); if (!amountReceived) { -- 2.39.5