aboutsummaryrefslogtreecommitdiffstats
path: root/util/scan/scan.c
diff options
context:
space:
mode:
authoretobi <git@e-tobi.net>2013-09-03 09:48:52 +0200
committeretobi <git@e-tobi.net>2013-09-03 09:48:52 +0200
commit5501530a778ad588a8ccd3f1584ea58f74c0cec9 (patch)
tree125c0eb7951f4b97c6b2be809332dcbe3633083c /util/scan/scan.c
parent76c08672bc6c2984ebd7045a71862099890c9118 (diff)
downloadlinux-dvb-apps-cc959eca1e097172d8ae38bb19b90648ca5d8d8f.tar.gz
Imported Upstream version 1.1.1+rev1483upstream/1.1.1+rev1483
Diffstat (limited to 'util/scan/scan.c')
-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 */