Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mpegts: tables - print only one table error per 10 seconds + total er…
…rors value
  • Loading branch information
perexg committed Aug 20, 2014
1 parent 2e5b239 commit a82cdec
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/input/mpegts.h
Expand Up @@ -197,6 +197,9 @@ struct mpegts_table

int8_t mt_cc;

time_t mt_last_perr; // last printer error
size_t mt_errors; // total number of table errors

mpegts_psi_section_t mt_sect;

struct mpegts_table_mux_cb *mt_mux_cb;
Expand Down
18 changes: 15 additions & 3 deletions src/input/mpegts/mpegts_table.c
Expand Up @@ -61,16 +61,28 @@ mpegts_table_dispatch
len = ((sec[1] & 0x0f) << 8) | sec[2];

if (tid == 0x72) { /* stuffing section */
if (len != r - 3)
tvhwarn(mt->mt_name, "stuffing found with trailing data (len %i, total %zi)", len, r);
if (len != r - 3) {
mt->mt_errors++;
if (mt->mt_last_perr + 10 < dispatch_clock) {
tvhwarn(mt->mt_name, "stuffing found with trailing data "
"(len %i, total %zi, errors %zi)",
len, r, mt->mt_errors);
mt->mt_last_perr = dispatch_clock;
}
}
dvb_table_reset(mt);
return;
}

/* It seems some hardware (or is it the dvb API?) does not
honour the DMX_CHECK_CRC flag, so we check it again */
if(chkcrc && tvh_crc32(sec, r, 0xffffffff)) {
tvhwarn(mt->mt_name, "invalid checksum (len %zi)", r);
mt->mt_errors++;
if (mt->mt_last_perr + 10 < dispatch_clock) {
tvhwarn(mt->mt_name, "invalid checksum (len %zi, errors %zi)",
r, mt->mt_errors);
mt->mt_last_perr = dispatch_clock;
}
return;
}

Expand Down

0 comments on commit a82cdec

Please sign in to comment.