__u16 pid;
int fd;
int used;
+ int pollretries;
int parse_err;
};
list_add(&sidnum->list, &filt->sids);
} else {
pat->has_nit = pid;
- dprintf2("found NIT at PID: %d", pid);
+ dprintf2("found NIT at PID: %d\n", pid);
}
}
return 0;
static int start(char *dmxdev, struct sid_data *sid_data, int timeout) {
unsigned char pes[4096];
struct pollfd pfd, pollfd[MAX_SIMULTANEOUS_PMT];
+ int pollretries[MAX_SIMULTANEOUS_PMT];
int pat_restart = 0, done = 0, size, i;
int ret;
pollfd[count].fd=filt->fd;
pollfd[count].events = POLLIN;
pollfd[count].revents = 0;
+ pollretries[count] = filt->pollretries++;
count++;
}
}
dprintf3("polling %d fds\n", count);
poll(pollfd, count, timeout);
for(i = 0; i < count; i++) {
- if(! (pollfd[i].revents & POLLIN))
+ if(! (pollfd[i].revents & POLLIN)) {
+ // stop waiting if no data comes for too long..
+ if (pollretries[i] >= 10) {
+ dprintf0("start: giving up wait for pid on filter %d, no data found...\n",i);
+ found++;
+ }
continue;
+ }
// read pmt
while((size = read(pollfd[i].fd, pes, sizeof(pes))) >= 3) {
struct filter *filt;
} else {
dprintf0("Didn't find sid for pid: %d\n", dmxcmd->pid);
}
+ } else {
+ dprintf0("Didn't find sid for pid: %d\n", dmxcmd->pid);
}
}
}