diff options
author | Jonathan McCrohan <jmccrohan@gmail.com> | 2013-09-17 00:36:06 +0100 |
---|---|---|
committer | Jonathan McCrohan <jmccrohan@gmail.com> | 2013-09-17 00:36:06 +0100 |
commit | 1516b6d1f29a58a818c1bea4ea255a8b782b7360 (patch) | |
tree | b6b72a56db2eb9bf1fba96634ea69222cb1d321f /util/szap/tzap.c | |
parent | ba777477e09e25a9e106d843440b84c420254d05 (diff) | |
parent | 60584e13787af008063469fba29334090d56d8d4 (diff) | |
download | linux-dvb-apps-1516b6d1f29a58a818c1bea4ea255a8b782b7360.tar.gz |
Merge tag 'upstream/1.1.1+rev1500'
Upstream version 1.1.1+rev1500
Diffstat (limited to '')
-rw-r--r-- | util/szap/tzap.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/util/szap/tzap.c b/util/szap/tzap.c index ce63832..5f84cb0 100644 --- a/util/szap/tzap.c +++ b/util/szap/tzap.c @@ -351,21 +351,20 @@ int parse(const char *fname, const char *channel, } -static -int setup_frontend (int fe_fd, struct dvb_frontend_parameters *frontend) +static int setup_frontend (int fe_fd, struct dvb_frontend_parameters *frontend) { - struct dvb_frontend_info fe_info; + int ret; + uint32_t mstd; - if (ioctl(fe_fd, FE_GET_INFO, &fe_info) < 0) { - PERROR("ioctl FE_GET_INFO failed"); + if (check_frontend(fe_fd, FE_OFDM, &mstd) < 0) { + close(fe_fd); return -1; } - - if (fe_info.type != FE_OFDM) { - ERROR ("frontend device is not a OFDM (DVB-T) device"); + ret = dvbfe_set_delsys(fe_fd, SYS_DVBT); + if (ret) { + PERROR("SET Delsys failed"); return -1; } - if (silent < 2) fprintf (stderr,"tuning to %i Hz\n", frontend->frequency); @@ -373,7 +372,6 @@ int setup_frontend (int fe_fd, struct dvb_frontend_parameters *frontend) PERROR("ioctl FE_SET_FRONTEND failed"); return -1; } - return 0; } @@ -417,7 +415,7 @@ static void print_frontend_stats(int fe_fd, int human_readable) } static -int check_frontend (int fe_fd, int human_readable) +int monitor_frontend (int fe_fd, int human_readable) { fe_status_t status; do { @@ -593,7 +591,7 @@ int main(int argc, char **argv) if (parse (confname, channel, &frontend_param, &vpid, &apid, &sid)) return -1; - if ((frontend_fd = open(FRONTEND_DEV, O_RDWR)) < 0) { + if ((frontend_fd = open(FRONTEND_DEV, O_RDWR | O_NONBLOCK)) < 0) { PERROR ("failed opening '%s'", FRONTEND_DEV); return -1; } @@ -678,7 +676,7 @@ int main(int argc, char **argv) print_frontend_stats(frontend_fd, human_readable); } else { just_the_frontend_dude: - check_frontend(frontend_fd, human_readable); + monitor_frontend(frontend_fd, human_readable); } close(pat_fd); |