[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libcdio-devel] Re: Retrieving DATA session from multisession audio disc

From: Thomas Schmitt
Subject: [Libcdio-devel] Re: Retrieving DATA session from multisession audio disc
Date: Thu, 18 Feb 2010 10:31:41 +0100


> I want to do all these things using libcdio:
> A) Extract a DATA track from a multi-session audio disc, output to ISO file
> format. Duplicate the functionality of 'extricate'.

The normal funktions lseek(2) and read(2)
should suffice for a data track if you
know where to lseek() and how much to read().
The lseek address in your example should be
222145 * 2048 .
(I.e. do not count the audio blocks by their
 payload of 2352 bytes, but as 2048 bytes.)

But libcdio describes own read functions in
I would assume the track is of cdio_read_mode_t
(Will libcdio deliver 2052 bytes per sector ?
 I personally do only Mode 1 reading.)

> B) Interact with the ISO file that has strange offsets

(I have no clue whether libcdio has means for
 that. One would have to apply the offset to
 all data i/o operations in the image, except
 the reading of the volume descriptors.)

> C) Tool to modify in-place the "offset" of an ISO file sector references

This would in fact demand a thorough re-write
of volume descriptors and the directory tree.

The most simple method would be to mount the
image and to use a ISO 9660 creation tool
to copy the mounted tree into a new ISO image.
  mkisofs -C 0,$new_offset ...
  xorriso -as mkisofs -C 0,$new_offset ...
  xorriso -grow_blindly $new_offset \
          -outdev $target_file_or_drive \

A more demanding approach would be to find
all entities in the image which bear a block
address. One would have to study ECMA-119 for
candidates and implement a tree traverser which
visits all directory entries.

Chances are good that you spoil your first
images. Main problem will be to find the last
subtle bugs.

> make your own CD-EXTRA disc.

For that purpose the simple method should

But beware:
You have to expect that the data files in the
ISO image know about sector addresses of the
other tracks on the original media.
If those tracks change, then you have to patch
those file contents too. And that depends
entirely on the application purpose of the
image. Not on any ISO 9660 / ECM-119 spec.

Have a nice day :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]