summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-06 11:43:44 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-06 11:43:44 +0000
commit5aa2b2b489822f5377579c6618cd41318403fac8 (patch)
tree4fa132733cf5e4ea34c1ed23dfb5a6d1c9abb968
parent01ace0891b1aaa0c5874ae1074780c80094a158d (diff)
downloadmpv-5aa2b2b489822f5377579c6618cd41318403fac8.tar.bz2
mpv-5aa2b2b489822f5377579c6618cd41318403fac8.tar.xz
moved actual tuning code from check_status() to tune_it()
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21833 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--stream/dvb_tune.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/stream/dvb_tune.c b/stream/dvb_tune.c
index 54cf1f7960..23bc2ba28b 100644
--- a/stream/dvb_tune.c
+++ b/stream/dvb_tune.c
@@ -346,12 +346,6 @@ static int check_status(int fd_frontend,struct dvb_frontend_parameters* feparams
int ok=0, locks=0;
time_t tm1, tm2;
- if (ioctl(fd_frontend,FE_SET_FRONTEND,feparams) < 0)
- {
- mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR tuning channel\n");
- return -1;
- }
-
pfd[0].fd = fd_frontend;
pfd[0].events = POLLPRI;
@@ -443,21 +437,9 @@ static int check_status(int fd_frontend,FrontendParameters* feparams,int tuner_t
struct pollfd pfd[1];
- while(1)
- {
- if(ioctl(fd_frontend, FE_GET_EVENT, &event) == -1)
- break;
- }
-
i = 0; res = -1;
while ((i < 3) && (res < 0))
{
- if (ioctl(fd_frontend,FE_SET_FRONTEND,feparams) < 0)
- {
- mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR tuning channel\n");
- return -1;
- }
-
pfd[0].fd = fd_frontend;
pfd[0].events = POLLIN | POLLPRI;
@@ -652,6 +634,7 @@ static int tune_it(int fd_frontend, int fd_sec, unsigned int freq, unsigned int
#else
FrontendParameters feparams;
FrontendInfo fe_info;
+ FrontendEvent event;
struct secStatus sec_state;
#endif
@@ -785,7 +768,18 @@ static int tune_it(int fd_frontend, int fd_sec, unsigned int freq, unsigned int
#ifndef HAVE_DVB_HEAD
if (fd_sec) SecGetStatus(fd_sec, &sec_state);
+ while(1)
+ {
+ if(ioctl(fd_frontend, FE_GET_EVENT, &event) == -1)
+ break;
+ }
#endif
+ if(ioctl(fd_frontend,FE_SET_FRONTEND,&feparams) < 0)
+ {
+ mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR tuning channel\n");
+ return -1;
+ }
+
return(check_status(fd_frontend,&feparams,fe_info.type, (hi_lo ? LOF2 : LOF1), timeout));
}