[Mplayer-cvslog] CVS: main/libmpdemux dvbin.c,1.2,1.3

Alex Beregszaszi alex at mplayerhq.hu
Wed Aug 27 19:09:11 CEST 2003


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv2630/libmpdemux

Modified Files:
	dvbin.c 
Log Message:
This patch fixes:

1) if channels (in the list) are invalid excludes them
2) on encrypted/unreadable channels mplayer goes to the next/previous
3) when changing channel uninit all components but stream and input.

Nico <nsabbi at libero.it>



Index: dvbin.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/dvbin.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- dvbin.c	11 Aug 2003 00:02:46 -0000	1.2
+++ dvbin.c	27 Aug 2003 17:08:58 -0000	1.3
@@ -156,9 +156,10 @@
 	row_count = 0;
 	while(! feof(f) && row_count < 512)
 	{
-		if( fgets(line, CHANNEL_LINE_LEN, f) == NULL ) continue;
+		if( fgets(line, CHANNEL_LINE_LEN, f) == NULL )
+			continue;
 
-		if(line[0] == '#')
+		if((line[0] == '#') || (strlen(line) == 0))
 			continue;
 
 		ptr =  &(list->channels[list->NUM_CHANNELS]);
@@ -168,12 +169,22 @@
 			fields = sscanf(line, ter_conf,
 				&ptr->name, &ptr->freq, &inv, &bw, &cr, &tmp_lcr, &mod,
 				&transm, &gi, &tmp_hier, &ptr->vpid, &ptr->apid1);
+			/*
+			mp_msg(MSGT_DEMUX, MSGL_V,
+				"NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, VPID: %d, APID1: %d\n",
+				list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->vpid, ptr->apid1);
+			*/
 		}
 		else if(type == TUNER_CBL)
 		{
 			fields = sscanf(line, cbl_conf,
 				&ptr->name, &ptr->freq, &inv, &ptr->srate,
 				&cr, &mod, &ptr->vpid, &ptr->apid1);
+			/*
+			mp_msg(MSGT_DEMUX, MSGL_V,
+				"NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d, VPID: %d, APID1: %d\n",
+				list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->srate, ptr->vpid, ptr->apid1);
+			*/
 		}
 		else //SATELLITE
 		{
@@ -185,9 +196,13 @@
 			ptr->srate *=  1000UL;
 			ptr->tone = -1;
 			mp_msg(MSGT_DEMUX, MSGL_V,
-				"NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d, POL: %c, DISEQC: %d, TONE: %d, VPID: %d, APID1: %d, APID2: %d, TPID: %d, PROGID: %d, NUM: %d\n",
-				fields, ptr->name, ptr->freq, ptr->srate, ptr->pol, ptr->diseqc, ptr->tone, ptr->vpid, ptr->apid1, ptr->apid2, ptr->tpid, ptr->progid, list->NUM_CHANNELS);
+				"NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d, POL: %c, DISEQC: %d, TONE: %d, VPID: %d, APID1: %d, APID2: %d, TPID: %d, PROGID: %d\n",
+				list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->srate, ptr->pol, ptr->diseqc, ptr->tone, ptr->vpid, ptr->apid1, ptr->apid2, ptr->tpid, ptr->progid);
 		}
+
+
+		if(((ptr->vpid <= 0) && (ptr->apid1 <=0)) || (ptr->freq == 0))
+			continue;
 
 
 		if((type == TUNER_TER) || (type == TUNER_CBL))



More information about the MPlayer-cvslog mailing list