dvb-scan: don't handle NIT table by default on ATSC
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Sun, 16 Feb 2014 02:05:36 +0000 (11:05 +0900)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Sun, 16 Feb 2014 02:31:25 +0000 (11:31 +0900)
With ATSC, the NIT table data is not useful at scan, as the only
non-automatically-detected parameter is the modulation. Well, the
modulation is mandatory anyway.

So, the scanning tool don't need the NIT table at all.

As NIT table is not always present (it isn't in KR), that makes
the scan procedure faster.

We could eventually disable it for other delivery systems, but
that would require an extra parameter on two functions, and this
would break userspace API. So, let's apply this patch instead.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
lib/libdvbv5/dvb-scan.c

index 69b175a..2cdb413 100644 (file)
@@ -407,16 +407,18 @@ struct dvb_v5_descriptors *dvb_get_ts_tables(struct dvb_v5_fe_parms *parms,
        dvb_scan_handler->num_program = num_pmt;
 
        /* NIT table */
-       rc = dvb_read_section(parms, dmx_fd,
-                             DVB_TABLE_NIT, DVB_TABLE_NIT_PID,
-                             (uint8_t **)&dvb_scan_handler->nit,
-                             nit_time * timeout_multiply);
-       if (parms->abort)
-               return dvb_scan_handler;
-       if (rc < 0)
-               dvb_logerr("error while reading the NIT table");
-       else if (parms->verbose)
-               dvb_table_nit_print(parms, dvb_scan_handler->nit);
+       if (!dvb_scan_handler->vct || other_nit) {
+               rc = dvb_read_section(parms, dmx_fd,
+                                     DVB_TABLE_NIT, DVB_TABLE_NIT_PID,
+                                     (uint8_t **)&dvb_scan_handler->nit,
+                                     nit_time * timeout_multiply);
+               if (parms->abort)
+                       return dvb_scan_handler;
+               if (rc < 0)
+                       dvb_logerr("error while reading the NIT table");
+               else if (parms->verbose)
+                       dvb_table_nit_print(parms, dvb_scan_handler->nit);
+       }
 
        /* SDT table */
        if (!dvb_scan_handler->vct || other_nit) {