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)
{
#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)
{
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;
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);
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);