1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00
This commit is contained in:
Marcus Metzler 2019-08-03 14:47:05 +02:00
parent bf8460adfb
commit 9c462b89ec

View File

@ -234,11 +234,12 @@ static int set_pmts(struct dddvb_ca *ca, uint8_t **pmts)
int i, size, num, len; int i, size, num, len;
if (!ca->resource_ready) if (!ca->resource_ready)
return 0; return -EBUSY;
dbgprintf(DEBUG_CA, "handle pmts\n"); for (i = 0; i < MAX_PMT; i++)
for (i = num = 0; i < MAX_PMT; i++) if (!pmts[i])
if (pmts[i]) break;
num++; num = i;
dbgprintf(DEBUG_CA, "handle %d pmts\n", num);
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
memcpy(sec, pmts[i], 3); memcpy(sec, pmts[i], 3);
len = ((sec[1] & 0x0f) << 8) | sec[2]; len = ((sec[1] & 0x0f) << 8) | sec[2];
@ -419,6 +420,7 @@ static void handle_ci(struct dddvb_ca *ca)
} }
pthread_mutex_unlock(&ca->mutex); pthread_mutex_unlock(&ca->mutex);
/*
if (!ca->sentpmt) if (!ca->sentpmt)
handle_pmts(ca); handle_pmts(ca);
else { else {
@ -428,6 +430,7 @@ static void handle_ci(struct dddvb_ca *ca)
pmt_count = 0; pmt_count = 0;
} }
} }
*/
tdt_count++; tdt_count++;
if (tdt_count == 10) { if (tdt_count == 10) {
//handle_tdt(ca); //handle_tdt(ca);
@ -594,7 +597,7 @@ static int init_ca(struct dddvb *dd, int a, int f, int fd)
sprintf(fname, "/dev/dvb/adapter%d/ci%d", a, f); sprintf(fname, "/dev/dvb/adapter%d/ci%d", a, f);
ca->ci_wfd = open(fname, O_WRONLY); ca->ci_wfd = open(fname, O_WRONLY);
ca->ci_rfd = open(fname, O_RDONLY); ca->ci_rfd = open(fname, O_RDONLY | O_NONBLOCK);
dd->dvbca_num++; dd->dvbca_num++;
return 0; return 0;
} }