On 32 bits, the frequency got truncated and become a negative
number. Fix it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brisa.lan>
#include <libdvbv5/desc_isdbt_delivery.h>
#include <libdvbv5/dvb-fe.h>
+#include <inttypes.h>
int isdbt_desc_delivery_init(struct dvb_v5_fe_parms *parms,
const uint8_t *buf, struct dvb_desc *desc)
dvb_loginfo("| area code %d", d->area_code);
for (i = 0; i < d->num_freqs; i++) {
- dvb_loginfo("| frequency[%d] %ld Hz", i, d->frequency[i] * 1000000l / 7);
+ dvb_loginfo("| frequency[%d] %" PRIu64 " Hz", i, (((uint64_t)d->frequency[i]) * 1000000ul) / 7);
}
}
}
for (i = 0; i < d->num_freqs; i++) {
- uint32_t frq = d->frequency[i] * 1000000l / 7;
+ uint32_t frq = (((uint64_t)d->frequency[i]) * 1000000ul / 7);
new = dvb_scan_add_entry(tr->parms, tr->first_entry, tr->entry,
frq, tr->shift, tr->pol);