From 6e300d82c7ed1ff261e44212fd9b0f32cc9e4669 Mon Sep 17 00:00:00 2001 From: arpi Date: Wed, 8 Jan 2003 16:10:39 +0000 Subject: [PATCH] do not create bogus filenames git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8842 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdvdkit2/libdvdcss.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libmpdvdkit2/libdvdcss.c b/libmpdvdkit2/libdvdcss.c index d566144334..b287da3f63 100644 --- a/libmpdvdkit2/libdvdcss.c +++ b/libmpdvdkit2/libdvdcss.c @@ -273,14 +273,15 @@ extern dvdcss_t dvdcss_open ( char *psz_target ) 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=§or[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: