[Mplayer-cvslog] CVS: main/libmpdemux dvb_tune.c,1.6,1.7

Nico Sabbi CVS syncmail at mplayerhq.hu
Mon Apr 26 23:18:09 CEST 2004


CVS change done by Nico Sabbi CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv5548

Modified Files:
	dvb_tune.c 
Log Message:
new configuration structure, gcc warn silencing

Index: dvb_tune.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/dvb_tune.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- dvb_tune.c	19 Mar 2004 20:29:26 -0000	1.6
+++ dvb_tune.c	26 Apr 2004 21:18:07 -0000	1.7
@@ -52,7 +52,7 @@
 
 
 
-int dvb_get_tuner_type(dvb_priv_t *priv)
+int dvb_get_tuner_type(int fe_fd)
 {
 #ifdef HAVE_DVB_HEAD
   struct dvb_frontend_info fe_info;
@@ -60,9 +60,7 @@
   FrontendInfo fe_info;
 #endif
 
-  int res, fe_fd;
-
-  fe_fd = priv->fe_fd;
+  int res;
 
   res = ioctl(fe_fd, FE_GET_INFO, &fe_info);
   if(res < 0)
@@ -74,15 +72,15 @@
   switch(fe_info.type)
   {
 	case FE_OFDM:
-      mp_msg(MSGT_DEMUX, MSGL_INFO, "TUNER TYPE SEEMS TO BE DVB-T\n");
+      mp_msg(MSGT_DEMUX, MSGL_V, "TUNER TYPE SEEMS TO BE DVB-T\n");
 	  return TUNER_TER;
 
 	case FE_QPSK:
-      mp_msg(MSGT_DEMUX, MSGL_INFO, "TUNER TYPE SEEMS TO BE DVB-S\n");
+      mp_msg(MSGT_DEMUX, MSGL_V, "TUNER TYPE SEEMS TO BE DVB-S\n");
 	  return TUNER_SAT;
 
 	case FE_QAM:
-      mp_msg(MSGT_DEMUX, MSGL_INFO, "TUNER TYPE SEEMS TO BE DVB-C\n");
+      mp_msg(MSGT_DEMUX, MSGL_V, "TUNER TYPE SEEMS TO BE DVB-C\n");
 	  return TUNER_CBL;
 
 	default:
@@ -92,26 +90,46 @@
 
 }
 
-
-int dvb_open_fe(dvb_priv_t *priv)
+int dvb_open_devices(dvb_priv_t *priv, int n)
 {
-	priv->fe_fd = open(dvb_frontenddev[priv->card], O_RDWR | O_NONBLOCK);
+	priv->fe_fd = open(dvb_frontenddev[n], O_RDWR | O_NONBLOCK);
 	if(priv->fe_fd < 0)
 	{
-		mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR IN OPENING FRONTEND DEVICE %s: ERRNO %d\n", dvb_frontenddev[priv->card], errno);
+		mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR OPENING FRONTEND DEVICE %s: ERRNO %d\n", dvb_frontenddev[n], errno);
 		return 0;
 	}
 #ifdef HAVE_DVB_HEAD
     priv->sec_fd=0;
 #else
-	priv->sec_fd = open(dvb_secdev[priv->card], O_RDWR);
+	priv->sec_fd = open(dvb_secdev[n], O_RDWR);
     if(priv->sec_fd < 0)
     {
-		mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR IN OPENING SEC DEVICE %s: ERRNO %d\n", dvb_secdev[priv->card], errno);
+		mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR OPENING SEC DEVICE %s: ERRNO %d\n", dvb_secdev[n], errno);
 		close(priv->fe_fd);
       	return 0;
     }
 #endif
+	priv->demux_fd[0] = open(dvb_demuxdev[n], O_RDWR);
+	if(priv->demux_fd[0] < 0)
+	{
+		mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR OPENING DEMUX 0: %d\n", errno);
+		return 0;
+	}
+
+	priv->demux_fd[1] = open(dvb_demuxdev[n], O_RDWR);
+	if(priv->demux_fd[1] < 0)
+	{
+		mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR OPENING DEMUX 1: %d\n", errno);
+		return 0;
+	}
+
+
+	priv->dvr_fd = open(dvb_dvrdev[n], O_RDONLY| O_NONBLOCK);
+	if(priv->dvr_fd < 0)
+	{
+		mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR OPENING DVR DEVICE %s: %d\n", dvb_dvrdev[n], errno);
+		return 0;
+	}
 
     return 1;
 }
@@ -172,7 +190,7 @@
 	fe_transmit_mode_t TransmissionMode, fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth);
 
 
-dvb_tune(dvb_priv_t *priv, int freq, char pol, int srate, int diseqc, int tone,
+int dvb_tune(dvb_priv_t *priv, int freq, char pol, int srate, int diseqc, int tone,
 		fe_spectral_inversion_t specInv, fe_modulation_t modulation, fe_guard_interval_t guardInterval,
 		fe_transmit_mode_t TransmissionMode, fe_bandwidth_t bandWidth, fe_code_rate_t HP_CodeRate)
 {
@@ -270,7 +288,6 @@
 #ifdef HAVE_DVB_HEAD
 static int check_status(int fd_frontend,struct dvb_frontend_parameters* feparams, int tuner_type, uint32_t base)
 {
-	int res;
 	int32_t strength;
 	fe_status_t festatus;
 	struct dvb_frontend_event event;




More information about the MPlayer-cvslog mailing list