libdvbv5: fix parsing of the default_value
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Fri, 5 Sep 2014 02:46:14 +0000 (23:46 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Fri, 5 Sep 2014 02:46:14 +0000 (23:46 -0300)
The parameters were wrong filled. Fix it. While here, add some
parenthesis at the expressions that check for it.

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

index 13d5ff2..c8f7a12 100644 (file)
@@ -382,7 +382,7 @@ int dvb_write_format_oneline(const char *fname,
                        for (j = 0; j < entry->n_props; j++)
                                if (entry->props[j].cmd == table->prop)
                                        break;
-                       if (fmt->table[i].has_default_value && fmt->table[i].default_value == entry->props[j].u.data && i == fmt->size - 1)
+                       if (fmt->table[i].has_default_value && (fmt->table[i].default_value == entry->props[j].u.data) && (i == fmt->size - 1))
                                break;
                        if (table->size && j < entry->n_props) {
                                data = entry->props[j].u.data;
index 8cfbb93..a217e63 100644 (file)
@@ -139,7 +139,7 @@ static const struct parse_table sys_dvbs2_table[] = {
        { DTV_INNER_FEC, PTABLE(channel_parse_code_rate) },
        { DTV_ROLLOFF, PTABLE(channel_parse_rolloff) },
        { DTV_MODULATION, PTABLE(channel_parse_modulation) },
-       { DTV_STREAM_ID, NULL, 0, 1, -1 },
+       { DTV_STREAM_ID, NULL, 0, 0, 1, -1 },
 };
 
 static const struct parse_table sys_dvbt_table[] = {
@@ -162,7 +162,7 @@ static const struct parse_table sys_dvbt2_table[] = {
        { DTV_TRANSMISSION_MODE, PTABLE(channel_parse_trans_mode) },
        { DTV_GUARD_INTERVAL, PTABLE(channel_parse_guard_interval) },
        { DTV_HIERARCHY, PTABLE(channel_parse_hierarchy) },
-       { DTV_STREAM_ID, NULL, 0, 1, -1 },
+       { DTV_STREAM_ID, NULL, 0, 0, 1, -1 },
 };
 
 const struct parse_file channel_file_format = {