diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2000-09-17 08:23:46 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2000-09-17 08:23:46 +0200 |
commit | 4716cfb5a1ebae09a8a277b8943d3a885dcf1365 (patch) | |
tree | 59394b5784b6ba8cfb83bb5b526f655401bc6253 /eit.c | |
parent | 7fbf9e6c49430ca2de4683dc7319aa32d247a0f6 (diff) | |
download | vdr-4716cfb5a1ebae09a8a277b8943d3a885dcf1365.tar.gz vdr-4716cfb5a1ebae09a8a277b8943d3a885dcf1365.tar.bz2 |
Implemented centralized 'wait for input'
Diffstat (limited to 'eit.c')
-rw-r--r-- | eit.c | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -13,7 +13,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: eit.c 1.1 2000/09/03 10:22:25 kls Exp $ + * $Id: eit.c 1.2 2000/09/17 08:02:30 kls Exp $ ***************************************************************************/ #include "eit.h" @@ -22,7 +22,6 @@ #include <unistd.h> #include <fcntl.h> #include <time.h> -#include <sys/poll.h> #include <sys/ioctl.h> #include <dvb_comcode.h> #include "tools.h" @@ -253,15 +252,12 @@ int cEIT::GetSection(unsigned char *buf, ushort PID, unsigned char sec) int seclen=0; unsigned short handle, pid; unsigned char section, sectionnum=0xff, maxsec=0; - struct pollfd pfd; if ((handle = SetBitFilter(PID, (sec<<8)|0x00ff, SECTION_CONTINUOS))==0xffff) return -1; seclen=0; - pfd.fd=fsvbi; - pfd.events=POLLIN; - if (poll(&pfd, 1, 20000)==0) + if (!cFile::AnyFileReady(fsvbi, 20000)) { //cerr << "Timeout\n"; return -1; @@ -318,7 +314,6 @@ int cEIT::GetEIT() struct eit_short_event_descriptor_struct *eitevt; int seclen; unsigned short handle, pid; - struct pollfd pfd; eit_event * pevt = (eit_event *)0; time_t tstart; @@ -344,9 +339,7 @@ int cEIT::GetEIT() tstart = time(NULL); while ((!evtRunning.bIsValid || !evtNext.bIsValid) && nReceivedEITs < 20 && difftime(time(NULL), tstart) < 4) { - pfd.fd=fsvbi; - pfd.events=POLLIN; - if (poll(&pfd, 1, 5000)==0) + if (!cFile::AnyFileReady(fsvbi, 5000)) { //cerr << "Timeout\n"; CloseFilter(handle); |