diff options
author | Jonathan McCrohan <jmccrohan@gmail.com> | 2013-09-17 00:36:05 +0100 |
---|---|---|
committer | Jonathan McCrohan <jmccrohan@gmail.com> | 2013-09-17 00:36:05 +0100 |
commit | 60584e13787af008063469fba29334090d56d8d4 (patch) | |
tree | 0cc62ecfe2e6b91d5b758f8813b0374c098b0541 /util/szap/azap.c | |
parent | 5501530a778ad588a8ccd3f1584ea58f74c0cec9 (diff) | |
download | linux-dvb-apps-a458528edafa1cb5702dbc7654a6ea86b629d14a.tar.gz |
Imported Upstream version 1.1.1+rev1500upstream/1.1.1+rev1500upstream
Diffstat (limited to '')
-rw-r--r-- | util/szap/azap.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/util/szap/azap.c b/util/szap/azap.c index 230a7b9..d024b46 100644 --- a/util/szap/azap.c +++ b/util/szap/azap.c @@ -216,18 +216,14 @@ int parse(const char *fname, const char *channel, static int setup_frontend (int fe_fd, struct dvb_frontend_parameters *frontend) { - struct dvb_frontend_info fe_info; + uint32_t mstd; - if (ioctl(fe_fd, FE_GET_INFO, &fe_info) < 0) { - PERROR("ioctl FE_GET_INFO failed"); - return -1; - } - - if (fe_info.type != FE_ATSC) { - ERROR ("frontend device is not an ATSC (VSB/QAM) device"); + if (check_frontend(fe_fd, FE_ATSC, &mstd) < 0) { + close(fe_fd); return -1; } + /* TODO! Some frontends need to be explicit delivery system */ printf ("tuning to %i Hz\n", frontend->frequency); if (ioctl(fe_fd, FE_SET_FRONTEND, frontend) < 0) { @@ -240,7 +236,7 @@ int setup_frontend (int fe_fd, struct dvb_frontend_parameters *frontend) static -int check_frontend (int fe_fd) +int monitor_frontend (int fe_fd) { fe_status_t status; uint16_t snr, signal; @@ -344,7 +340,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; } @@ -392,7 +388,7 @@ int main(int argc, char **argv) if (set_pesfilter (audio_fd, apid, DMX_PES_AUDIO, dvr) < 0) return -1; - check_frontend (frontend_fd); + monitor_frontend (frontend_fd); close (pat_fd); close (pmt_fd); |