]> git.vomp.tv Git - vompserver.git/commitdiff
Live TV priority overriding
authorChris Tallon <chris@vomp.tv>
Wed, 26 Oct 2005 21:33:31 +0000 (21:33 +0000)
committerChris Tallon <chris@vomp.tv>
Wed, 26 Oct 2005 21:33:31 +0000 (21:33 +0000)
mvpclient.c
mvpreceiver.c
mvpreceiver.h

index 94430ccdefe2f6d215df81d4a37ccffe5db54204..b5d7346cf2b6d062206d5ca61534724d69b1583f 100644 (file)
@@ -422,7 +422,25 @@ void MVPClient::processStartStreamingChannel(UCHAR* data, int length)
     return;
   }
 
-  lp = MVPReceiver::create(channel);
+  // get the priority we should use
+  int fail = 1;
+  int priority = config.getValueLong("General", "Live priority", &fail);
+  if (!fail)
+  {
+    log->log("Client", Log::DEBUG, "Config: Live TV priority: %i", priority);
+  }
+  else
+  {
+    log->log("Client", Log::DEBUG, "Config: Live TV priority config fail");
+    priority = 0;
+  }
+
+  // a bit of sanity..
+  if (priority < 0) priority = 0;
+  if (priority > 99) priority = 99;
+
+  log->log("Client", Log::DEBUG, "Using live TV priority %i", priority);
+  lp = MVPReceiver::create(channel, priority);
 
   if (!lp)
   {
index 6614304b7f317659ad69b606a1db822b32bd60ca..34be52c366a6b623db4dea614ea2b45266885332 100755 (executable)
@@ -1,9 +1,9 @@
 #include "mvpreceiver.h"
 
-MVPReceiver* MVPReceiver::create(cChannel* channel)
+MVPReceiver* MVPReceiver::create(cChannel* channel, int priority)
 {
   bool NeedsDetachReceivers;
-  cDevice* device = cDevice::GetDevice(channel, 0, &NeedsDetachReceivers);
+  cDevice* device = cDevice::GetDevice(channel, priority, &NeedsDetachReceivers);
 
   if (!device)
   {
@@ -11,12 +11,16 @@ MVPReceiver* MVPReceiver::create(cChannel* channel)
     return NULL;
   }
 
+/*
   if (NeedsDetachReceivers)
   {
     // can't really happen since we stream with priority zero. if a rec has pri zero maybe
     Log::getInstance()->log("MVPReceiver", Log::DEBUG, "Needs detach receivers");
     return NULL;
   }
+*/
+
+  // What should we do if NeedsDetachReceivers is true?
 
   MVPReceiver* m = new MVPReceiver(channel, device);
   return m;
@@ -51,16 +55,16 @@ MVPReceiver::MVPReceiver(cChannel* channel, cDevice* device)
     logger->log("MVPReceiver", Log::DEBUG, "Created new < 1.3 TS->PS");
 //  }
 #else
-  if ((channel->Vpid() == 0) || (channel->Vpid() == 1) || (channel->Vpid() == 0x1FFF))
-  {
-    remuxer = new cTS2ESRemux(channel->Apid(0));
-    logger->log("MVPReceiver", Log::DEBUG, "Created new > 1.3 TS->ES");
-  }
-  else
-  {
+//  if ((channel->Vpid() == 0) || (channel->Vpid() == 1) || (channel->Vpid() == 0x1FFF))
+//  {
+//    remuxer = new cTS2ESRemux(channel->Apid(0));
+//    logger->log("MVPReceiver", Log::DEBUG, "Created new > 1.3 TS->ES");
+//  }
+//  else
+//  {
     remuxer = new cTS2PSRemux(channel->Vpid(), channel->Apid(0), 0, 0, 0, 0);
     logger->log("MVPReceiver", Log::DEBUG, "Created new > 1.3 TS->PS");
-  }
+//  }
 #endif
 
   unprocessed = new cRingBufferLinear(1000000, TS_SIZE * 2, false);
index 2d1440d8faf6408ce549c866d23918e93094304f..26068775fe89e99adffd6b16d7a4643a943cb3c1 100755 (executable)
@@ -37,7 +37,7 @@
 class MVPReceiver : public cReceiver, public Thread
 {
   public:
-    static MVPReceiver* create(cChannel*);
+    static MVPReceiver* create(cChannel*, int priority);
     virtual ~MVPReceiver();
     int init();
     unsigned long getBlock(unsigned char* buffer, unsigned long amount);