From 8f7e6e565e5f75074f715bf7c5387d25811b8c3c Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 29 Sep 2014 14:34:06 +0200 Subject: [PATCH] scanfile: fix DVB-T bandwidth parsing for dvbv5 format, fixes #2336 --- src/input/mpegts/scanfile.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/input/mpegts/scanfile.c b/src/input/mpegts/scanfile.c index ecd1647b..58432516 100644 --- a/src/input/mpegts/scanfile.c +++ b/src/input/mpegts/scanfile.c @@ -422,9 +422,17 @@ scanfile_load_dvbv5 ( scanfile_network_t *net, char *line, fb_file *fp ) mux->u.dmc_fe_ofdm.hierarchy_information = DVB_HIERARCHY_NONE; mux->dmc_fe_inversion = DVB_INVERSION_AUTO; - if ((x = htsmsg_get_str(l, "BANDWIDTH_HZ"))) + if ((x = htsmsg_get_str(l, "BANDWIDTH_HZ"))) { + if (isdigit(x[0])) { + /* convert to kHz */ + int64_t ll = strtoll(x, NULL, 0); + ll /= 1000; + snprintf(buf, sizeof(buf), "%llu", (long long unsigned)ll); + x = buf; + } if ((mux->u.dmc_fe_ofdm.bandwidth = dvb_str2bw(x)) == -1) mux_fail(r, "wrong bandwidth '%s'", x); + } if ((x = htsmsg_get_str(l, "CODE_RATE_HP"))) if ((mux->u.dmc_fe_ofdm.code_rate_HP = dvb_str2fec(x)) == -1) mux_fail(r, "wrong code rate HP '%s'", x);