aboutsummaryrefslogtreecommitdiffstats
path: root/util/scan/scan.c
diff options
context:
space:
mode:
authorMark Purcell <msp@debian.org>2012-05-13 19:42:13 +1000
committeretobi <git@e-tobi.net>2013-09-03 09:48:54 +0200
commita537361120f6d717bfdf2793c82d2435ee0c9126 (patch)
tree73c81bb7e5d5d7e7b604b785d3a3ca7e46537850 /util/scan/scan.c
parent96bce3638e9b6d3f3bac79494e11d877857de81e (diff)
parent5501530a778ad588a8ccd3f1584ea58f74c0cec9 (diff)
downloadlinux-dvb-apps-a537361120f6d717bfdf2793c82d2435ee0c9126.tar.gz
Imported Debian patch 1.1.1+rev1483-1debian/1.1.1+rev1483-1
Diffstat (limited to '')
-rw-r--r--util/scan/scan.c40
1 files changed, 40 insertions, 0 deletions
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,14 +1934,54 @@ 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));
/* ignore cable descriptors in sat NIT and vice versa */