diff options
Diffstat (limited to 'util/szap/szap.c')
-rw-r--r-- | util/szap/szap.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/util/szap/szap.c b/util/szap/szap.c index 9de752e..90bdbfb 100644 --- a/util/szap/szap.c +++ b/util/szap/szap.c @@ -166,7 +166,7 @@ static int do_tune(int fefd, unsigned int ifreq, unsigned int sr) } -static int check_frontend (int fe_fd, int dvr, int human_readable) +static int monitor_frontend (int fe_fd, int dvr, int human_readable) { (void)dvr; fe_status_t status; @@ -220,9 +220,8 @@ int zap_to(unsigned int adapter, unsigned int frontend, unsigned int demux, char fedev[128], dmxdev[128], auddev[128]; static int fefd, dmxfda, dmxfdv, audiofd = -1, patfd, pmtfd; int pmtpid; - uint32_t ifreq; + uint32_t ifreq, mstd; int hiband, result; - static struct dvb_frontend_info fe_info; if (!fefd) { snprintf(fedev, sizeof(fedev), FRONTENDDEVICE, adapter, frontend); @@ -234,20 +233,11 @@ int zap_to(unsigned int adapter, unsigned int frontend, unsigned int demux, perror("opening frontend failed"); return FALSE; } - - result = ioctl(fefd, FE_GET_INFO, &fe_info); - if (result < 0) { - perror("ioctl FE_GET_INFO failed"); - close(fefd); - return FALSE; - } - - if (fe_info.type != FE_QPSK) { - fprintf(stderr, "frontend device is not a QPSK (DVB-S) device!\n"); + if (check_frontend(fefd, FE_QPSK, &mstd) < 0) { close(fefd); return FALSE; } - + /* TODO! Some frontends need to be explicit delivery system */ if ((dmxfdv = open(dmxdev, O_RDWR)) < 0) { perror("opening video demux failed"); close(fefd); @@ -322,7 +312,7 @@ int zap_to(unsigned int adapter, unsigned int frontend, unsigned int demux, } } - check_frontend (fefd, dvr, human_readable); + monitor_frontend (fefd, dvr, human_readable); if (!interactive) { close(patfd); close(pmtfd); |