[MPlayer-cvslog] r21833 - trunk/stream/dvb_tune.c

nicodvb subversion at mplayerhq.hu
Sat Jan 6 12:43:44 CET 2007


Author: nicodvb
Date: Sat Jan  6 12:43:44 2007
New Revision: 21833

Modified:
   trunk/stream/dvb_tune.c

Log:
moved actual tuning code from check_status() to tune_it()

Modified: trunk/stream/dvb_tune.c
==============================================================================
--- trunk/stream/dvb_tune.c	(original)
+++ trunk/stream/dvb_tune.c	Sat Jan  6 12:43:44 2007
@@ -346,12 +346,6 @@
 	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 @@
 	
 	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 @@
 #else
   FrontendParameters feparams;
   FrontendInfo fe_info;
+  FrontendEvent event;
   struct secStatus sec_state;
 #endif
 
@@ -785,7 +768,18 @@
 
 #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));
 }



More information about the MPlayer-cvslog mailing list