diff --git a/libtriple/dmx_td.cpp b/libtriple/dmx_td.cpp index 35efade..a491879 100644 --- a/libtriple/dmx_td.cpp +++ b/libtriple/dmx_td.cpp @@ -91,13 +91,14 @@ cDemux::~cDemux() bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBufferSize) { - int devnum = num; + devnum = num; int flags = O_RDWR; if (fd > -1) lt_info("%s FD ALREADY OPENED? fd = %d\n", __FUNCTION__, fd); 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__); 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) 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) { lt_info("%s #%d Pid = %hx open failed (%m)\n", __FUNCTION__, num, Pid); diff --git a/libtriple/dmx_td.h b/libtriple/dmx_td.h index 2656ca9..4b35ece 100644 --- a/libtriple/dmx_td.h +++ b/libtriple/dmx_td.h @@ -36,6 +36,7 @@ class cDemux { private: int num; + int devnum; int fd; int buffersize; bool measure;