X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/3bad22d5566624804a73b3791980bab2d84c8266..208747f6553a9cf68b26860d8c3c4999d180f5fb:/lib/dvb/demux.cpp diff --git a/lib/dvb/demux.cpp b/lib/dvb/demux.cpp index 4522706d..191d9c38 100644 --- a/lib/dvb/demux.cpp +++ b/lib/dvb/demux.cpp @@ -1,10 +1,16 @@ +#include #include #include #include #include #include +#if HAVE_DVB_API_VERSION < 3 +#include +#else #include +#endif + #include "crc32.h" #include @@ -61,9 +67,15 @@ void eDVBSectionReader::data(int) eDVBSectionReader::eDVBSectionReader(eDVBDemux *demux, eMainloop *context, RESULT &res): demux(demux) { char filename[128]; +#if HAVE_DVB_API_VERSION < 3 + sprintf(filename, "/dev/dvb/card%d/demux%d", demux->adapter, demux->demux); +#else sprintf(filename, "/dev/dvb/adapter%d/demux%d", demux->adapter, demux->demux); +#endif fd = ::open(filename, O_RDWR); + eDebug("eDVBSectionReader has fd %d", fd); + if (fd >= 0) { notifier=new eSocketNotifier(context, fd, eSocketNotifier::Read); @@ -92,11 +104,18 @@ RESULT eDVBSectionReader::start(const eDVBSectionFilterMask &mask) if (fd < 0) return -ENODEV; +#if HAVE_DVB_API_VERSION < 3 + dmxSctFilterParams sct; +#else dmx_sct_filter_params sct; - +#endif sct.pid = mask.pid; sct.timeout = 0; +#if HAVE_DVB_API_VERSION < 3 + sct.flags = 0; +#else sct.flags = DMX_IMMEDIATE_START; +#endif if (mask.flags & eDVBSectionFilterMask::rfCRC) { sct.flags |= DMX_CHECK_CRC; @@ -106,11 +125,25 @@ RESULT eDVBSectionReader::start(const eDVBSectionFilterMask &mask) memcpy(sct.filter.filter, mask.data, DMX_FILTER_SIZE); memcpy(sct.filter.mask, mask.mask, DMX_FILTER_SIZE); +#if HAVE_DVB_API_VERSION >= 3 memcpy(sct.filter.mode, mask.mode, DMX_FILTER_SIZE); +#endif res = ::ioctl(fd, DMX_SET_FILTER, &sct); if (!res) + { +#if HAVE_DVB_API_VERSION < 3 + res = ::ioctl(fd, DMX_SET_NEGFILTER_MASK, mask.mode); + if (!res) + { + res = ::ioctl(fd, DMX_START, 0); + if (!res) + active = 1; + } +#else active = 1; +#endif + } return res; }