From owner-freebsd-multimedia Sun Jan 21 19:10:27 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from magic.adaptec.com (magic.adaptec.com [208.236.45.80]) by hub.freebsd.org (Postfix) with ESMTP id 0D41637B401 for ; Sun, 21 Jan 2001 19:09:57 -0800 (PST) Received: from redfish.adaptec.com (redfish.adaptec.com [162.62.50.11]) by magic.adaptec.com (8.8.8+Sun/8.8.8) with ESMTP id TAA04724 for ; Sun, 21 Jan 2001 19:09:55 -0800 (PST) Received: from btc.btc.adaptec.com (btc.btc.adaptec.com [162.62.64.10]) by redfish.adaptec.com (8.8.8+Sun/8.8.8) with ESMTP id TAA02961 for ; Sun, 21 Jan 2001 19:03:16 -0800 (PST) Received: from btcexc01.btc.adaptec.com (btcexc01 [162.62.147.10]) by btc.btc.adaptec.com (8.8.8+Sun/8.8.8) with ESMTP id UAA04223 for ; Sun, 21 Jan 2001 20:09:52 -0700 (MST) Received: by btcexc01.btc.adaptec.com with Internet Mail Service (5.5.2650.21) id ; Sun, 21 Jan 2001 20:09:53 -0700 Message-ID: From: "Long, Scott" To: "'freebsd-multimedia@freebsd.org'" Subject: So ya want to play unlocked and unencryted pr0n DVDs... Date: Sun, 21 Jan 2001 20:08:50 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01C08420.A4E19140" Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01C08420.A4E19140 Content-Type: text/plain Ok, here ya go. These patches to the xine's UDF reader have made it so that I can play DVDs without having to pass in a .vob file, i.e. read the TOC and play chapter-by-chapter. This by no means fixes all of the bugs in xine.... manually advancing the chapter while the movie is playing causes a crash that I haven't been able to track down, and some DVDs that I own just don't want to play at all. These patches do not touch the much rumored 'magical DVD decryption plugin' that may or may not actually exist, they merely provide fixes to the UDF reader. Have fun. Scott FreeBSD - The power to watch unencrypted pr0n ------_=_NextPart_000_01C08420.A4E19140 Content-Type: application/octet-stream; name="xine.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="xine.diff" diff -c xine-0.3.5/input/dvd_udf.c xine-0.3.5.new/input/dvd_udf.c=0A= *** xine-0.3.5/input/dvd_udf.c Fri Jan 12 16:38:15 2001=0A= --- xine-0.3.5.new/input/dvd_udf.c Sun Jan 21 18:33:07 2001=0A= ***************=0A= *** 25,30 ****=0A= --- 25,31 ----=0A= =0A= =0A= #include =0A= + #include =0A= #include =0A= #include =0A= #include =0A= ***************=0A= *** 275,284 ****=0A= =0A= int UDFMapICB (int fd, struct AD ICB, uint8_t *FileType, struct AD = *File)=0A= {=0A= ! uint8_t LogBlock[DVD_VIDEO_LB_LEN];=0A= uint32_t lbnum;=0A= uint16_t TagID;=0A= =0A= lbnum=3Dpartition.Start+ICB.Location;=0A= =0A= do {=0A= --- 276,290 ----=0A= =0A= int UDFMapICB (int fd, struct AD ICB, uint8_t *FileType, struct AD = *File)=0A= {=0A= ! uint8_t *LogBlock;=0A= uint32_t lbnum;=0A= uint16_t TagID;=0A= =0A= + if ((LogBlock =3D (uint8_t*)malloc(DVD_VIDEO_LB_LEN)) =3D=3D NULL) = {=0A= + fprintf(stderr, "%s: malloc failed\n", __FUNCTION__);=0A= + return 0;=0A= + }=0A= + =0A= lbnum=3Dpartition.Start+ICB.Location;=0A= =0A= do {=0A= ***************=0A= *** 287,296 ****=0A= --- 293,304 ----=0A= =0A= if (TagID=3D=3D261) {=0A= UDFFileEntry(LogBlock,FileType,File);=0A= + free(LogBlock);=0A= return 1;=0A= };=0A= } while = ((lbnum<=3Dpartition.Start+ICB.Location+(ICB.Length-1)/DVD_VIDEO_LB_LEN)= && (TagID!=3D261));=0A= =0A= + free(LogBlock);=0A= return 0;=0A= }=0A= =0A= ***************=0A= *** 303,315 ****=0A= =0A= int UDFScanDir (int fd, struct AD Dir, char *FileName, struct AD = *FileICB)=0A= {=0A= ! uint8_t LogBlock[DVD_VIDEO_LB_LEN*30];=0A= uint32_t lbnum, lb_dir_end, offset;=0A= uint16_t TagID;=0A= uint8_t filechar;=0A= ! char filename[MAX_FILE_LEN];=0A= ! int p;=0A= =0A= =0A= /*=0A= * read complete directory=0A= --- 311,329 ----=0A= =0A= int UDFScanDir (int fd, struct AD Dir, char *FileName, struct AD = *FileICB)=0A= {=0A= ! uint8_t *LogBlock;=0A= uint32_t lbnum, lb_dir_end, offset;=0A= uint16_t TagID;=0A= uint8_t filechar;=0A= ! char *filename;=0A= ! int p, retval =3D 0;=0A= =0A= + LogBlock =3D (uint8_t*)malloc(DVD_VIDEO_LB_LEN * 30);=0A= + filename =3D (char*)malloc(MAX_FILE_LEN);=0A= + if ((LogBlock =3D=3D NULL) || (filename =3D=3D NULL)) {=0A= + fprintf(stderr, "%s: malloc failed\n", __FUNCTION__);=0A= + goto bail;=0A= + }=0A= =0A= /*=0A= * read complete directory=0A= ***************=0A= *** 335,347 ****=0A= =0A= if (TagID=3D=3D257) {=0A= p +=3D = UDFFileIdentifier(&LogBlock[p],&filechar,filename,FileICB);=0A= ! if (!strcasecmp (FileName,filename))=0A= ! return 1;=0A= } else=0A= p=3Doffset;=0A= }=0A= =0A= ! return 0;=0A= }=0A= =0A= =0A= --- 349,368 ----=0A= =0A= if (TagID=3D=3D257) {=0A= p +=3D = UDFFileIdentifier(&LogBlock[p],&filechar,filename,FileICB);=0A= ! if (!strcasecmp (FileName,filename)) {=0A= ! retval =3D 1;=0A= ! goto bail;=0A= ! }=0A= } else=0A= p=3Doffset;=0A= }=0A= =0A= ! retval =3D 0;=0A= ! =0A= ! bail:=0A= ! free(LogBlock);=0A= ! free(filename);=0A= ! return retval;=0A= }=0A= =0A= =0A= ***************=0A= *** 354,365 ****=0A= =0A= int UDFFindPartition (int fd, int partnum, struct Partition *part)=0A= {=0A= ! uint8_t LogBlock[DVD_VIDEO_LB_LEN],Anchor[DVD_VIDEO_LB_LEN];=0A= uint32_t lbnum,MVDS_location,MVDS_length;=0A= uint16_t TagID;=0A= uint32_t lastsector;=0A= ! int i,terminate,volvalid;=0A= =0A= =0A= /* find anchor */=0A= lastsector=3D0;=0A= --- 375,392 ----=0A= =0A= int UDFFindPartition (int fd, int partnum, struct Partition *part)=0A= {=0A= ! uint8_t *LogBlock,*Anchor;=0A= uint32_t lbnum,MVDS_location,MVDS_length;=0A= uint16_t TagID;=0A= uint32_t lastsector;=0A= ! int i,terminate,volvalid,retval =3D 0;=0A= =0A= + LogBlock =3D (uint8_t*)malloc(DVD_VIDEO_LB_LEN);=0A= + Anchor =3D (uint8_t*)malloc(DVD_VIDEO_LB_LEN);=0A= + if ((LogBlock =3D=3D NULL) || (Anchor =3D=3D NULL)) {=0A= + fprintf(stderr, "%s: malloc failed\n", __FUNCTION__);=0A= + goto bail;=0A= + }=0A= =0A= /* find anchor */=0A= lastsector=3D0;=0A= ***************=0A= *** 373,386 ****=0A= TagID=3D0;=0A= =0A= if (TagID!=3D2) { /* not an anchor? */=0A= ! if (terminate) return 0; /* final try failed */=0A= if (lastsector) { /* we already found the last sector */=0A= lbnum=3Dlastsector; /* try #3, alternative backup anchor */=0A= terminate=3D1; /* but thats just about enough, then! */=0A= } else {=0A= /* TODO: find last sector of the disc (this is optional) */=0A= if (lastsector) lbnum=3Dlastsector-256; /* try #2, backup anchor = */=0A= ! else return 0; /* unable to find last sector */=0A= }=0A= } else break; /* it is an anchor! continue... = */=0A= }=0A= --- 400,413 ----=0A= TagID=3D0;=0A= =0A= if (TagID!=3D2) { /* not an anchor? */=0A= ! if (terminate) goto bail; /* final try failed */=0A= if (lastsector) { /* we already found the last sector */=0A= lbnum=3Dlastsector; /* try #3, alternative backup anchor */=0A= terminate=3D1; /* but thats just about enough, then! */=0A= } else {=0A= /* TODO: find last sector of the disc (this is optional) */=0A= if (lastsector) lbnum=3Dlastsector-256; /* try #2, backup anchor = */=0A= ! else goto bail; /* unable to find last sector = */=0A= }=0A= } else break; /* it is an anchor! continue... = */=0A= }=0A= ***************=0A= *** 413,419 ****=0A= if ((!part->valid) || (!volvalid)) = UDFExtentAD(&Anchor[24],&MVDS_length,&MVDS_location); /* backup volume = descriptor */=0A= } while (i-- && ((!part->valid) || (!volvalid)));=0A= =0A= ! return (part->valid); /* we only care for the partition, not the = volume */=0A= }=0A= =0A= =0A= --- 440,451 ----=0A= if ((!part->valid) || (!volvalid)) = UDFExtentAD(&Anchor[24],&MVDS_length,&MVDS_location); /* backup volume = descriptor */=0A= } while (i-- && ((!part->valid) || (!volvalid)));=0A= =0A= ! retval =3D part->valid; /* we only care for the partition, not the = volume */=0A= ! =0A= ! bail:=0A= ! free(LogBlock);=0A= ! free(Anchor);=0A= ! return retval;=0A= }=0A= =0A= =0A= ***************=0A= *** 426,447 ****=0A= =0A= uint32_t UDFFindFile (int fd, char *filename, off_t *size)=0A= {=0A= ! uint8_t LogBlock[DVD_VIDEO_LB_LEN];=0A= uint8_t filetype;=0A= ! uint32_t lbnum;=0A= uint16_t TagID;=0A= struct AD RootICB,File,ICB;=0A= ! char tokenline[MAX_FILE_LEN] =3D "";=0A= char *token;=0A= off_t lb_number;=0A= - =0A= int Partition=3D0; /* this is the standard location for DVD Video = */=0A= =0A= ! strcat (tokenline,filename);=0A= =0A= /* Find partition */=0A= if (!UDFFindPartition(fd, Partition,&partition))=0A= ! return 0;=0A= =0A= /* Find root dir ICB */=0A= lbnum=3Dpartition.Start;=0A= --- 458,486 ----=0A= =0A= uint32_t UDFFindFile (int fd, char *filename, off_t *size)=0A= {=0A= ! uint8_t *LogBlock;=0A= uint8_t filetype;=0A= ! uint32_t lbnum, retval =3D 0;=0A= uint16_t TagID;=0A= struct AD RootICB,File,ICB;=0A= ! char *tokenline;=0A= char *token;=0A= off_t lb_number;=0A= int Partition=3D0; /* this is the standard location for DVD Video = */=0A= + =0A= + LogBlock =3D (uint8_t*)malloc(DVD_VIDEO_LB_LEN);=0A= + tokenline =3D (char*)malloc(MAX_FILE_LEN);=0A= + if ((LogBlock =3D=3D NULL) || (tokenline =3D=3D NULL)) {=0A= + fprintf(stderr, "%s: malloc failed\n", __FUNCTION__);=0A= + goto bail;=0A= + }=0A= + memset(tokenline, 0, MAX_FILE_LEN);=0A= =0A= ! strncat (tokenline,filename,MAX_FILE_LEN);=0A= =0A= /* Find partition */=0A= if (!UDFFindPartition(fd, Partition,&partition))=0A= ! goto bail;=0A= =0A= /* Find root dir ICB */=0A= lbnum=3Dpartition.Start;=0A= ***************=0A= *** 456,478 ****=0A= UDFAD(&LogBlock[400],&RootICB,UDFADlong);=0A= } while ((lbnum=3DnMaxFiles)=0A= ! return;=0A= =0A= }=0A= =0A= --- 634,644 ----=0A= if (strcmp (filename,"")) {=0A= =0A= dest =3D file_list[*nFiles];=0A= ! strncpy (dest,filename,256);=0A= (*nFiles)++;=0A= =0A= if ((*nFiles)>=3DnMaxFiles)=0A= ! goto bail;=0A= =0A= }=0A= =0A= ***************=0A= *** 600,604 ****=0A= --- 652,662 ----=0A= token=3Dntoken;=0A= ntoken=3Dstrtok(NULL,"/");=0A= }=0A= + =0A= + bail:=0A= + free(LogBlock);=0A= + free(tokenline);=0A= + free(filename);=0A= + return;=0A= }=0A= =0A= ------_=_NextPart_000_01C08420.A4E19140-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message