From: Mauro Carvalho Chehab Date: Fri, 2 May 2014 13:52:29 +0000 (-0700) Subject: libdvbv5: Fix the speedup scan condition X-Git-Tag: v4l-utils-1.2.0~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=adc0ad6b7943aee7382ade5587af7433d2b82218;p=platform%2Fupstream%2Fv4l-utils.git 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 --- 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;