]> git.vomp.tv Git - vompserver.git/commitdiff
Removed obselete code
authorChris Tallon <chris@vomp.tv>
Fri, 13 Jun 2008 16:44:44 +0000 (16:44 +0000)
committerChris Tallon <chris@vomp.tv>
Fri, 13 Jun 2008 16:44:44 +0000 (16:44 +0000)
mvpreceiver.c
mvpreceiver.h
vompclientrrproc.c

index 2135e3ce4c0a5449d91151070bad579ebce4ea44..13ae3c89021c153ed0b373f10e7734f84d0ba2bf 100755 (executable)
@@ -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;
-}
index 7fec4411416e9f27d4dcb2708cf2a73a8b92b8cc..8b5d87293d096880ee5965ce38bab0775e72e3de 100755 (executable)
@@ -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:
index de107962f08080c4d9b8100511151608c21480f9..824000f0df1d818decd44ea1915f60e293f91946 100644 (file)
@@ -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)
   {