Logo Search packages:      
Sourcecode: vcdimager version File versions

unsigned int vcdinfo_get_track_sect_count ( const vcdinfo_obj_t *  obj,
const track_t  track_num 
)

Return the size in sectors for track n.

The IS0-9660 filesystem track has number 1. Tracks associated with playable entries numbers start at 2.

FIXME: Whether we count the track pregap sectors is a bit haphazard. We should add a parameter to indicate whether this is wanted or not.

Return the size in sectors for track n.

The IS0-9660 filesystem track has number 0. Tracks associated with playable entries numbers start at 1.

FIXME: Whether we count the track pregap sectors is a bit haphazard. We should add a parameter to indicate whether this is wanted or not.

Definition at line 1380 of file info.c.

References vcdinfo_get_track_lsn(), vcdinfo_get_track_sect_count(), and VCDINFO_INVALID_TRACK.

Referenced by vcdinfo_get_track_sect_count().

{
  if (NULL == obj || VCDINFO_INVALID_TRACK == track_num) 
    return 0;
  
  {
    iso9660_stat_t *statbuf;
    const lsn_t lsn = vcdinfo_get_track_lsn(obj, track_num);
    
    /* Try to get the sector count from the ISO 9660 filesystem */
    if (obj->has_xa && (statbuf = iso9660_find_fs_lsn(obj->img, lsn))) {
      unsigned int secsize = statbuf->secsize;
      free(statbuf);
      return secsize;
    } else {
      const lsn_t next_lsn=vcdinfo_get_track_lsn(obj, track_num+1);
      /* Failed on ISO 9660 filesystem. Use track information.  */
      return next_lsn > lsn ? next_lsn - lsn : 0;
    }
  }
  return 0;
}


Generated by  Doxygen 1.6.0   Back to index