--- multiplexer/en300468ts.c 2010/09/29 21:38:12 1.22 +++ multiplexer/en300468ts.c 2010/09/29 21:39:04 1.23 @@ -231,6 +231,7 @@ struct sitab { struct sitab *next; unsigned char version; unsigned char tableid; + unsigned short tableid_ext; long pid; long freqmsec; enum enumsi esi; @@ -1491,22 +1492,29 @@ static void gentab(struct sitab *st, str perpid[i].tabin += l+2; } -static enum enumsi alloctab(long pid, long tid) +static enum enumsi alloctab(long pid, long tid, int *hastableidext) { enum enumsi e = si_none; switch (pid) { case 0x0010: - if ((tid == 0x40) || (tid == 0x41)) { + if (tid == 0x40) { e = nit; + } else if (tid == 0x41) { + e = nit; + *hastableidext = 1; } else { fprintf(stderr, "bad tableid: 0x%02lx (pid: 0x%04lx)\n", tid, pid); } break; case 0x0011: - if ((tid == 0x42) || (tid == 0x46)) { + if (tid == 0x42) { + e = sdt; + } else if (tid == 0x46) { e = sdt; + *hastableidext = 1; } else if (tid == 0x4A) { e = bat; + *hastableidext = 1; } else { fprintf(stderr, "bad tableid: 0x%02lx (pid: 0x%04lx)\n", tid, pid); } @@ -1514,6 +1522,7 @@ static enum enumsi alloctab(long pid, lo case 0x0012: if ((tid >= 0x4E) && (tid <= 0x6F)) { e = eit; + *hastableidext = 1; } else { fprintf(stderr, "bad tableid: 0x%02lx (pid: 0x%04lx)\n", tid, pid); } @@ -1576,12 +1585,14 @@ static void maketab(long pid, long table { struct sitab *t; enum enumsi e; - e = alloctab(pid, tableid); + int hastableidext = 0; + e = alloctab(pid, tableid, &hastableidext); if (e >= 0) { t = malloc(sizeof(struct sitab)); if (t != NULL) { t->pid = pid; t->tableid = tableid; + t->tableid_ext = hastableidext; t->freqmsec = freqmsec; t->esi = e; t->tab = NULL; @@ -2192,6 +2203,9 @@ static void argloop(int f0) free(newtab->tab); free(newtab); } else { + if (newtab->tableid_ext) { + newtab->tableid_ext = newtab->tab[0]; + } droptab(newtab->pid, newtab->tableid); newtab->version = nextversion[newtab->tableid - TABLEID_FIRST]; newtab->soon = tv;