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/czap.c | |
parent | 5501530a778ad588a8ccd3f1584ea58f74c0cec9 (diff) | |
download | linux-dvb-apps-upstream.tar.gz |
Imported Upstream version 1.1.1+rev1500upstream/1.1.1+rev1500upstream
Diffstat (limited to 'util/szap/czap.c')
-rw-r--r-- | util/szap/czap.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/util/szap/czap.c b/util/szap/czap.c index 8a97d98..f49c524 100644 --- a/util/szap/czap.c +++ b/util/szap/czap.c @@ -180,32 +180,30 @@ int parse(const char *fname, int list_channels, int chan_no, 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_QAM, &mstd) < 0) { + close(fe_fd); return -1; } - - if (fe_info.type != FE_QAM) { - ERROR ("frontend device is not a QAM (DVB-C) device"); + ret = dvbfe_set_delsys(fe_fd, SYS_DVBC_ANNEX_A); + if (ret) { + PERROR("SET Delsys failed"); return -1; } - if (ioctl(fe_fd, FE_SET_FRONTEND, frontend) < 0) { PERROR ("ioctl FE_SET_FRONTEND failed"); return -1; } - return 0; } static -int check_frontend (int fe_fd, int human_readable) +int monitor_frontend (int fe_fd, int human_readable) { fe_status_t status; uint16_t snr, signal; @@ -347,7 +345,7 @@ int main(int argc, char **argv) if (list_channels) return 0; - 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; } @@ -393,7 +391,7 @@ int main(int argc, char **argv) if (set_pesfilter (audio_fd, apid, DMX_PES_AUDIO, dvr) < 0) return -1; - check_frontend (frontend_fd, human_readable); + monitor_frontend (frontend_fd, human_readable); close (pat_fd); close (pmt_fd); |