[Mplayer-cvslog] CVS: main/libmpdvdkit2 libdvdcss.c,1.6,1.7

Arpi of Ize arpi at mplayerhq.hu
Wed Jan 8 17:10:56 CET 2003


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

Modified Files:
	libdvdcss.c 
Log Message:
do not create bogus filenames


Index: libdvdcss.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdvdkit2/libdvdcss.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- libdvdcss.c	29 Dec 2002 15:34:50 -0000	1.6
+++ libdvdcss.c	8 Jan 2003 16:10:39 -0000	1.7
@@ -273,14 +273,15 @@
 	char sector[DVDCSS_BLOCK_SIZE];
 	// 32768+40  -> disc title (32 uppercase chars)
 	// 32768+813 -> disc manufacturing date + serial no (16 digit number)
-	dvdcss->pf_seek( dvdcss, 32768/DVDCSS_BLOCK_SIZE);
+	int ret=dvdcss->pf_seek( dvdcss, 32768/DVDCSS_BLOCK_SIZE);
+	//printf("disc_id seek: %d -> %d,  i_fd=%d  i_read_fd=%d\n",32768/DVDCSS_BLOCK_SIZE,ret,dvdcss->i_fd,dvdcss->i_read_fd);
 	if(dvdcss->pf_read( dvdcss, sector, 1) == 1){
 	    // check disc title first:
 	    char* title_name=&sector[40];
-	    int i=31;
-	    while(i>=0 && title_name[i]<=32) i--;
-	    title_name[i+1]=0;
-	    if(strlen(title_name)>5){
+	    int i=0;
+	    while(i<32 && title_name[i]>='0' && title_name[i]<='z') i++;
+	    title_name[i]=0;
+	    if(i>5){
 		disc_id=strdup(title_name);
 	    } else {
 		// use disc date+serial:



More information about the MPlayer-cvslog mailing list