libtriple: fix neutrino streamdev

This commit is contained in:
Stefan Seyfried
2013-01-23 21:29:27 +01:00
parent 393f5452f4
commit 5cb4a9d274
2 changed files with 5 additions and 3 deletions

View File

@@ -91,13 +91,14 @@ cDemux::~cDemux()
bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBufferSize) bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBufferSize)
{ {
int devnum = num; devnum = num;
int flags = O_RDWR; int flags = O_RDWR;
if (fd > -1) if (fd > -1)
lt_info("%s FD ALREADY OPENED? fd = %d\n", __FUNCTION__, fd); lt_info("%s FD ALREADY OPENED? fd = %d\n", __FUNCTION__, fd);
if (pes_type == DMX_TP_CHANNEL) if (pes_type == DMX_TP_CHANNEL)
{ {
if (num == 0) /* streaminfo measurement, let's cheat... */ /* see neutrino's src/gui/streaminfo2.cpp for the buffer size */
if (num == 0 && uBufferSize == 3 * 3008 * 62) /* streaminfo measurement, let's cheat... */
{ {
lt_info("%s num=0 and DMX_TP_CHANNEL => measurement demux\n", __func__); lt_info("%s num=0 and DMX_TP_CHANNEL => measurement demux\n", __func__);
devnum = 2; /* demux 0 is used for live, demux 1 for recording */ devnum = 2; /* demux 0 is used for live, demux 1 for recording */
@@ -535,7 +536,7 @@ bool cDemux::addPid(unsigned short Pid)
} }
if (fd == -1) if (fd == -1)
lt_info("%s bucketfd not yet opened? pid=%hx\n", __FUNCTION__, Pid); lt_info("%s bucketfd not yet opened? pid=%hx\n", __FUNCTION__, Pid);
pfd.fd = open(devname[num], O_RDWR); pfd.fd = open(devname[devnum], O_RDWR);
if (pfd.fd < 0) if (pfd.fd < 0)
{ {
lt_info("%s #%d Pid = %hx open failed (%m)\n", __FUNCTION__, num, Pid); lt_info("%s #%d Pid = %hx open failed (%m)\n", __FUNCTION__, num, Pid);

View File

@@ -36,6 +36,7 @@ class cDemux
{ {
private: private:
int num; int num;
int devnum;
int fd; int fd;
int buffersize; int buffersize;
bool measure; bool measure;