~ubuntu-branches/ubuntu/raring/libdvdread/raring-proposed

« back to all changes in this revision

Viewing changes to src/dvd_udf.c

  • Committer: Package Import Robot
  • Author(s): Bryce Harrington
  • Date: 2012-07-19 17:31:40 UTC
  • mfrom: (1.3.1) (3.2.13 sid)
  • Revision ID: package-import@ubuntu.com-20120719173140-blyupuocrr7zrusn
Tags: 4.2.0+20120521-2ubuntu1
* Merge with debian unstable.  Remaining Ubuntu changes:
  - Re-add missing install-css.sh.
  - debian/control: add Suggests for install-css.sh on wget, debhelper, etc.
  - debian/rules: install install-css.sh, leave perms executable.
  - Disable hurd.patch
* Drop 100-quell-vts-tmapt-warning.patch: Taken upstream to Debian
* Drop 102-reorder-linkage.patch: No longer applies.
* Drop 103-iforead-tt-srpt-pointerfix.patch: Taken upstream to Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
  uint32_t AccessType;
81
81
  uint32_t Start;
82
82
  uint32_t Length;
 
83
  uint32_t FSD_Location;
 
84
  uint32_t FSD_Length;
83
85
};
84
86
 
85
87
struct AD {
99
101
  struct extent_ad rvds;
100
102
};
101
103
 
 
104
struct fsd_t {
 
105
  uint16_t Partition;
 
106
  uint32_t Location;
 
107
  uint32_t Length;
 
108
};
 
109
 
102
110
struct pvd_t {
103
111
  uint8_t VolumeIdentifier[32];
104
112
  uint8_t VolumeSetIdentifier[128];
423
431
  return 0;
424
432
}
425
433
 
 
434
/**
 
435
 * Reads the File Set Descriptor from the Logical Volume Descriptor.
 
436
 */
 
437
static void UDFFSD( uint8_t *data, struct fsd_t *fsd )
 
438
{
 
439
  fsd->Length = GETN4(248);    /* always 2048? */
 
440
  fsd->Location = GETN4(252);
 
441
  fsd->Partition = GETN2(256); /* always 0? */
 
442
}
 
443
 
426
444
static int UDFFileEntry( uint8_t *data, uint8_t *FileType,
427
445
                         struct Partition *partition, struct AD *ad )
428
446
{
611
629
            memcpy(FileICB, &tmpICB, sizeof(tmpICB));
612
630
            found = 1;
613
631
          }
614
 
          UDFMapICB(device, tmpICB, &tmpFiletype, partition, &tmpFile);
 
632
          if(!UDFMapICB(device, tmpICB, &tmpFiletype, partition, &tmpFile))
 
633
            return 0;
 
634
 
615
635
        } else {
616
636
          if( !strcasecmp( FileName, filename ) ) {
617
637
            memcpy(FileICB, &tmpICB, sizeof(tmpICB));
765
785
        /* Logical Volume Descriptor */
766
786
        if( UDFLogVolume( LogBlock, part->VolumeDesc ) ) {
767
787
          /* TODO: sector size wrong! */
768
 
        } else
769
 
          volvalid = 1;
 
788
        } else {
 
789
          struct fsd_t fsd;
 
790
 
 
791
          UDFFSD(LogBlock, &fsd);
 
792
          if(part->Number == fsd.Partition) {
 
793
            part->FSD_Location = fsd.Location;
 
794
            part->FSD_Length = fsd.Length;
 
795
            volvalid = 1;
 
796
          } else {
 
797
            /* TODO: Oups, how to handle this? */
 
798
          }
 
799
        }
770
800
      }
771
801
 
772
802
    } while( ( lbnum <= MVDS_location + ( MVDS_length - 1 )
809
839
    SetUDFCache(device, PartitionCache, 0, &partition);
810
840
 
811
841
    /* Find root dir ICB */
812
 
    lbnum = partition.Start;
 
842
    lbnum = partition.Start + partition.FSD_Location;
 
843
    /*
 
844
    fprintf(stderr, "Looking for FSD at 0x%x\n", lbnum);
 
845
    */
813
846
    do {
814
847
      if( DVDReadLBUDF( device, lbnum++, 1, LogBlock, 0 ) <= 0 )
815
848
        TagID = 0;