[MPlayer-cvslog] r20675 - in trunk/stream: dvbin.h stream_dvb.c

nicodvb subversion at mplayerhq.hu
Sun Nov 5 00:03:53 CET 2006


Author: nicodvb
Date: Sun Nov  5 00:03:52 2006
New Revision: 20675

Modified:
   trunk/stream/dvbin.h
   trunk/stream/stream_dvb.c

Log:
nonsense removal: compare old and new frequency in order to skip tuning

Modified: trunk/stream/dvbin.h
==============================================================================
--- trunk/stream/dvbin.h	(original)
+++ trunk/stream/dvbin.h	Sun Nov  5 00:03:52 2006
@@ -100,9 +100,9 @@
 	int tuner_type;
 	int is_on;
 	stream_t *stream;
-	char new_tuning[256], prev_tuning[256];
 	int retry;
 	int timeout;
+	int last_freq;
 } dvb_priv_t;
 
 

Modified: trunk/stream/stream_dvb.c
==============================================================================
--- trunk/stream/stream_dvb.c	(original)
+++ trunk/stream/stream_dvb.c	Sun Nov  5 00:03:52 2006
@@ -458,7 +458,6 @@
 {
 	dvb_channels_list *new_list;
 	dvb_channel_t *channel;
-	int do_tuning;
 	stream_t *stream  = (stream_t*) priv->stream;
 	char buf[4096];
 	dvb_config_t *conf = (dvb_config_t *) priv->config;
@@ -495,7 +494,6 @@
 				mp_msg(MSGT_DEMUX, MSGL_ERR, "DVB_SET_CHANNEL, COULDN'T OPEN DEVICES OF CARD: %d, EXIT\n", card);
 				return 0;
 			}
-			strcpy(priv->prev_tuning, "");
 		}
 		else	//close all demux_fds with pos > pids required for the new channel or open other demux_fds if we have too few
 		{	
@@ -510,7 +508,6 @@
 			mp_msg(MSGT_DEMUX, MSGL_ERR, "DVB_SET_CHANNEL2, COULDN'T OPEN DEVICES OF CARD: %d, EXIT\n", card);
 			return 0;
 		}
-		strcpy(priv->prev_tuning, "");
 	}
 
 	dvb_config->priv = priv;
@@ -521,52 +518,16 @@
 	stream->fd = priv->dvr_fd;
 	mp_msg(MSGT_DEMUX, MSGL_V, "DVB_SET_CHANNEL: new channel name=%s, card: %d, channel %d\n", channel->name, card, n);
 
-	switch(priv->tuner_type)
-	{
-		case TUNER_SAT:
-			sprintf(priv->new_tuning, "%d|%09d|%09d|%d|%c", priv->card, channel->freq, channel->srate, channel->diseqc, channel->pol);
-			break;
-
-		case TUNER_TER:
-			sprintf(priv->new_tuning, "%d|%09d|%d|%d|%d|%d|%d|%d", priv->card, channel->freq, channel->inv,
-				channel->bw, channel->cr, channel->mod, channel->trans, channel->gi);
-		  break;
-
-		case TUNER_CBL:
-			sprintf(priv->new_tuning, "%d|%09d|%d|%d|%d|%d", priv->card, channel->freq, channel->inv, channel->srate,
-				channel->cr, channel->mod);
-		break;
-#ifdef DVB_ATSC
-		case TUNER_ATSC:
-			sprintf(priv->new_tuning, "%d|%09d|%d", priv->card, channel->freq, channel->mod);
-		break;
-#endif
-	}
-
-
-
-	if(strcmp(priv->prev_tuning, priv->new_tuning))
-	{
-		mp_msg(MSGT_DEMUX, MSGL_V, "DIFFERENT TUNING THAN THE PREVIOUS: %s  -> %s\n", priv->prev_tuning, priv->new_tuning);
-		strcpy(priv->prev_tuning, priv->new_tuning);
-		do_tuning = 1;
-	}
-	else
-	{
-		mp_msg(MSGT_DEMUX, MSGL_V, "SAME TUNING PARAMETERS, NO TUNING\n");
-		do_tuning = 0;
-	}
-
 	stream->eof=1;
 	stream_reset(stream);
 
 
-	if(do_tuning)
+	if(channel->freq != priv->last_freq)
 		if (! dvb_tune(priv, channel->freq, channel->pol, channel->srate, channel->diseqc, channel->tone,
 			channel->inv, channel->mod, channel->gi, channel->trans, channel->bw, channel->cr, channel->cr_lp, channel->hier, priv->timeout))
 			return 0;
 
-
+	priv->last_freq = channel->freq;
 	priv->is_on = 1;
 
 	//sets demux filters and restart the stream
@@ -666,7 +627,6 @@
 	}
 
 
-	strcpy(priv->prev_tuning, "");
 	if(!dvb_set_channel(priv, priv->card, priv->list->current))
 	{
 		mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR, COULDN'T SET CHANNEL  %i: ", priv->list->current);



More information about the MPlayer-cvslog mailing list