From adc0ad6b7943aee7382ade5587af7433d2b82218 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 2 May 2014 06:52:29 -0700 Subject: [PATCH] libdvbv5: Fix the speedup scan condition The DVB table read routine has 3 operational modes: it can seek for an specific table section, it can expect sequential table sections, or it can wait non-sequencial sections, stopping when a section is duplicated. The second mode (sequencial table sections) finishes the reading after receiving all table sections from 0 to the max table section, speeding up its reception, while being more reliant to section errors. However, the tests for the stop condition for this mode were wrong. Fix it. Signed-off-by: Mauro Carvalho Chehab --- lib/libdvbv5/dvb-scan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libdvbv5/dvb-scan.c b/lib/libdvbv5/dvb-scan.c index dfb597a..297ac59 100644 --- a/lib/libdvbv5/dvb-scan.c +++ b/lib/libdvbv5/dvb-scan.c @@ -196,7 +196,7 @@ static int dvb_parse_section(struct dvb_v5_fe_parms *parms, if (priv->last_section < 0) priv->last_section = h.last_section; else { /* Check if the table was already parsed, but not on first pass */ - if (!sect->allow_section_gaps && sect->ts_id != -1) { + if (!sect->allow_section_gaps && sect->ts_id == -1) { if (test_bit(h.section_id, priv->is_read_bits)) return 0; } else if (priv->first_ts_id == h.id && priv->first_section == h.section_id) { @@ -217,7 +217,7 @@ static int dvb_parse_section(struct dvb_v5_fe_parms *parms, } /* handle the sections */ - if (!sect->allow_section_gaps && sect->ts_id != -1) + if (!sect->allow_section_gaps && sect->ts_id == -1) set_bit(h.section_id, priv->is_read_bits); if (dvb_table_initializers[tid]) @@ -227,7 +227,7 @@ static int dvb_parse_section(struct dvb_v5_fe_parms *parms, dvb_logerr("%s: no initializer for table %d", __func__, tid); - if (!sect->allow_section_gaps && sect->ts_id != -1 && + if (!sect->allow_section_gaps && sect->ts_id == -1 && is_all_bits_set(priv->last_section, priv->is_read_bits)) priv->done = 1; -- 2.7.4