mpegts: stop NIT processing from hanging

Was stupidly returning error (instead of marking complete) when unwanted
NID is detected. This causes real problems on DVB-C, and possibly DVB-S.

Might need to revisit some SDT stuff, which I think was blocking, and
now isn't waiting, for NIT.
This commit is contained in:
Adam Sutton 2013-11-27 17:50:24 +00:00
parent 446e063b0c
commit d25fba8a14
2 changed files with 10 additions and 5 deletions

View file

@ -142,6 +142,7 @@ struct mpegts_table
RB_HEAD(,mpegts_table_state) mt_state;
int mt_complete;
int mt_incomplete;
int mt_finished;
int mt_count;

View file

@ -421,6 +421,7 @@ mpegts_table_state_reset
mt->mt_complete--;
mt->mt_incomplete++;
}
mt->mt_finished = 0;
st->complete = 0;
memset(st->sections, 0, sizeof(st->sections));
for (i = 0; i < last / 32; i++)
@ -465,7 +466,9 @@ dvb_table_complete
mt->mt_incomplete, mt->mt_complete, total);
return -1;
}
tvhdebug(mt->mt_name, "subtable completed");
if (!mt->mt_finished)
tvhdebug(mt->mt_name, "completed pid %d table %08X / %08x", mt->mt_pid, mt->mt_table, mt->mt_mask);
mt->mt_finished = 1;
return 0;
}
@ -745,17 +748,18 @@ dvb_nit_callback
r = dvb_table_begin(mt, ptr, len, tableid, nbid, 7, &st, &sect, &last, &ver);
if (r != 1) return r;
/* BAT */
/* NIT */
if (tableid != 0x4A) {
/* Specific NID */
if (mn->mn_nid) {
if (mn->mn_nid != nbid)
return -1;
if (mn->mn_nid != nbid) {
return dvb_table_end(mt, st, sect);
}
/* Only use "this" network */
} else if (tableid != 0x40) {
return -1;
return dvb_table_end(mt, st, sect);
}
}