From 8b22c3fc0d014df5a204e0a3d06127b28b6b4226 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Sun, 13 Jul 2014 10:39:03 +0200 Subject: [PATCH] mpegts table dispatch: added back the assert to see the bug --- src/input/mpegts/mpegts_input.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/input/mpegts/mpegts_input.c b/src/input/mpegts/mpegts_input.c index 0d85202a..2cfa2a0a 100644 --- a/src/input/mpegts/mpegts_input.c +++ b/src/input/mpegts/mpegts_input.c @@ -542,7 +542,7 @@ mpegts_input_recv_packets static void mpegts_input_table_dispatch ( mpegts_mux_t *mm, const uint8_t *tsb ) { - int i, len = 0; + int i, len = 0, c = 0; uint16_t pid = ((tsb[1] & 0x1f) << 8) | tsb[2]; uint8_t cc = (tsb[3] & 0x0f); mpegts_table_t *mt, **vec; @@ -552,6 +552,7 @@ mpegts_input_table_dispatch ( mpegts_mux_t *mm, const uint8_t *tsb ) i = mm->mm_num_tables; vec = alloca(i * sizeof(mpegts_table_t *)); LIST_FOREACH(mt, &mm->mm_tables, mt_link) { + c++; if (mt->mt_destroyed || !mt->mt_subscribed) continue; mpegts_table_grab(mt); @@ -559,6 +560,10 @@ mpegts_input_table_dispatch ( mpegts_mux_t *mm, const uint8_t *tsb ) vec[len++] = mt; } pthread_mutex_unlock(&mm->mm_tables_lock); + if (i != c) { + tvherror("psi", "tables count inconsistency (num %d, list %d)", i, c); + assert(0); + } /* Process */ for (i = 0; i < len; i++) {