@@ -1141,8 +1141,11 @@ static int get_program_and_store(struct dvb_v5_fe_parms_priv *parms,
if (!channel && entry->props[j].cmd == DTV_FREQUENCY)
freq = parms->dvb_prop[j].u.data;
}
- if (!channel) {
- r = asprintf(&channel, "%.2fMHz#%d", freq/1000000., service_id);
+ if (!*channel) {
+ free(channel);
+ r = asprintf(&channel, "%.2f%cHz#%d", freq / 1000000.,
+ dvb_fe_is_satellite(parms->p.current_sys) ? 'G' : 'M',
+ service_id);
if (r < 0)
dvb_perror("asprintf");
dvb_log("Storing Service ID %d: '%s'", service_id, channel);
@@ -1240,13 +1243,20 @@ int dvb_store_channel(struct dvb_file **dvb_file,
if (!warned) {
dvb_log("WARNING: no SDT table - storing channel(s) without their names");
warned = 1;
+
+ rc = asprintf(&channel, "#%d", service_id);
+ if (rc < 0) {
+ dvb_perror("asprintf");
+ return rc;
}
rc = get_program_and_store(parms, *dvb_file, dvb_scan_handler,
service_id, NULL, NULL,
get_detected, get_nit);
- if (rc < 0)
+ if (rc < 0) {
+ free(channel);
return rc;
+ }
}
return 0;