Mercurial > mplayer.hg
comparison libmpdvdkit2/libdvdcss.c @ 8841:ddf6a9f4cc6a
do not create bogus filenames
author | arpi |
---|---|
date | Wed, 08 Jan 2003 16:10:39 +0000 |
parents | a2fa276b8ec7 |
children | f0f0f176d298 |
comparison
equal
deleted
inserted
replaced
8840:cecb561fcb21 | 8841:ddf6a9f4cc6a |
---|---|
271 char* disc_id=NULL; | 271 char* disc_id=NULL; |
272 /*char title_name[64];*/ | 272 /*char title_name[64];*/ |
273 char sector[DVDCSS_BLOCK_SIZE]; | 273 char sector[DVDCSS_BLOCK_SIZE]; |
274 // 32768+40 -> disc title (32 uppercase chars) | 274 // 32768+40 -> disc title (32 uppercase chars) |
275 // 32768+813 -> disc manufacturing date + serial no (16 digit number) | 275 // 32768+813 -> disc manufacturing date + serial no (16 digit number) |
276 dvdcss->pf_seek( dvdcss, 32768/DVDCSS_BLOCK_SIZE); | 276 int ret=dvdcss->pf_seek( dvdcss, 32768/DVDCSS_BLOCK_SIZE); |
277 //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); | |
277 if(dvdcss->pf_read( dvdcss, sector, 1) == 1){ | 278 if(dvdcss->pf_read( dvdcss, sector, 1) == 1){ |
278 // check disc title first: | 279 // check disc title first: |
279 char* title_name=§or[40]; | 280 char* title_name=§or[40]; |
280 int i=31; | 281 int i=0; |
281 while(i>=0 && title_name[i]<=32) i--; | 282 while(i<32 && title_name[i]>='0' && title_name[i]<='z') i++; |
282 title_name[i+1]=0; | 283 title_name[i]=0; |
283 if(strlen(title_name)>5){ | 284 if(i>5){ |
284 disc_id=strdup(title_name); | 285 disc_id=strdup(title_name); |
285 } else { | 286 } else { |
286 // use disc date+serial: | 287 // use disc date+serial: |
287 title_name=§or[813]; | 288 title_name=§or[813]; |
288 title_name[16]=0; | 289 title_name[16]=0; |