dvb: simplify the logic that sets a (compat) DTV delivery system
authorMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 15 Dec 2013 15:32:02 +0000 (13:32 -0200)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 15 Dec 2013 15:32:02 +0000 (13:32 -0200)
Instead of using a loop, just call the existing function for
retrieve a parameter inside an entry.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
lib/libdvbv5/dvb-scan.c
utils/dvb/dvbv5-zap.c

index e97ddfa..fc59289 100644 (file)
@@ -468,14 +468,12 @@ struct dvb_v5_descriptors *dvb_scan_transponder(struct dvb_v5_fe_parms *parms,
                                                unsigned timeout_multiply)
 {
        struct dvb_v5_descriptors *dvb_scan_handler = NULL;
-       uint32_t freq;
+       uint32_t freq, delsys = SYS_UNDEFINED;
        int i, rc;
 
        /* First of all, set the delivery system */
-       for (i = 0; i < entry->n_props; i++)
-               if (entry->props[i].cmd == DTV_DELIVERY_SYSTEM)
-                       dvb_set_compat_delivery_system(parms,
-                                                       entry->props[i].u.data);
+       retrieve_entry_prop(entry, DTV_DELIVERY_SYSTEM, &delsys);
+       dvb_set_compat_delivery_system(parms, delsys);
 
        /* Copy data into parms */
        for (i = 0; i < entry->n_props; i++) {
index 44e8116..8399046 100644 (file)
@@ -225,11 +225,9 @@ static int parse(struct arguments *args,
        }
        *sid = entry->service_id;
 
-       /* First of all, set the delivery system */
-       for (i = 0; i < entry->n_props; i++)
-               if (entry->props[i].cmd == DTV_DELIVERY_SYSTEM)
-                       dvb_set_compat_delivery_system(parms,
-                                                      entry->props[i].u.data);
+        /* First of all, set the delivery system */
+       retrieve_entry_prop(entry, DTV_DELIVERY_SYSTEM, &sys);
+       dvb_set_compat_delivery_system(parms, sys);
 
        /* Copy data into parms */
        for (i = 0; i < entry->n_props; i++) {