From: Akihiro Tsukada <tskd08@xxxxxxxxx> Signed-off-by: Akihiro Tsukada <tskd08@xxxxxxxxx> --- lib/libdvbv5/dvb-file.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/libdvbv5/dvb-file.c b/lib/libdvbv5/dvb-file.c index 27d9a63..bcb1762 100644 --- a/lib/libdvbv5/dvb-file.c +++ b/lib/libdvbv5/dvb-file.c @@ -1121,20 +1121,21 @@ static int get_program_and_store(struct dvb_v5_fe_parms_priv *parms, if (rc) dvb_logerr("Couldn't get frontend props"); } - if (!*channel) { - r = asprintf(&channel, "%.2fMHz#%d", freq/1000000., service_id); - if (r < 0) - dvb_perror("asprintf"); - if (parms->p.verbose) - dvb_log("Storing as: '%s'", channel); - } for (j = 0; j < parms->n_props; j++) { entry->props[j].cmd = parms->dvb_prop[j].cmd; entry->props[j].u.data = parms->dvb_prop[j].u.data; - if (!*channel && entry->props[j].cmd == DTV_FREQUENCY) + if ((!channel || !*channel) && + entry->props[j].cmd == DTV_FREQUENCY) freq = parms->dvb_prop[j].u.data; } + if (!channel || !*channel) { + r = asprintf(&channel, "%.2fMHz#%d", freq/1000000., service_id); + if (r < 0) + dvb_perror("asprintf"); + if (parms->p.verbose) + dvb_log("Storing as: '%s'", channel); + } entry->n_props = parms->n_props; entry->channel = channel; -- 2.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html