From 5501530a778ad588a8ccd3f1584ea58f74c0cec9 Mon Sep 17 00:00:00 2001 From: etobi Date: Tue, 3 Sep 2013 09:48:52 +0200 Subject: Imported Upstream version 1.1.1+rev1483 --- util/scan/scan.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'util/scan/scan.c') diff --git a/util/scan/scan.c b/util/scan/scan.c index 972d529..46bdb08 100644 --- a/util/scan/scan.c +++ b/util/scan/scan.c @@ -1934,13 +1934,53 @@ static int __tune_to_transponder (int frontend_fd, struct transponder *t) return -1; } +static set_delivery_system(int fd, unsigned type) +{ + struct dtv_properties props; + struct dtv_property dvb_prop[1]; + unsigned delsys; + + switch (type) { + case FE_QPSK: + delsys = SYS_DVBS; + break; + case FE_QAM: + delsys = SYS_DVBC_ANNEX_AC; + break; + case FE_OFDM: + delsys = SYS_DVBT; + break; + case FE_ATSC: + delsys = SYS_ATSC; + break; + default: + return -1; + } + + dvb_prop[0].cmd = DTV_DELIVERY_SYSTEM; + dvb_prop[0].u.data = delsys; + props.num = 1; + props.props = dvb_prop; + if (ioctl(fd, FE_SET_PROPERTY, &props) >= 0) + return 0; + return errno; +} + static int tune_to_transponder (int frontend_fd, struct transponder *t) { + int rc; + /* move TP from "new" to "scanned" list */ list_del_init(&t->list); list_add_tail(&t->list, &scanned_transponders); t->scan_done = 1; + if (t->type != fe_info.type) { + rc = set_delivery_system(frontend_fd, t->type); + if (!rc) + fe_info.type = t->type; + } + if (t->type != fe_info.type) { warning("frontend type (%s) is not compatible with requested tuning type (%s)\n", fe_type2str(fe_info.type),fe_type2str(t->type)); -- cgit v1.2.3