[Libburn] Re: How to pipe stdin to CD-RW ?

scdbackup at gmx.net scdbackup at gmx.net
Thu Dec 1 14:06:21 PST 2005


Hi,

i believe to understand that the obstacle to stdin piping 
is in 

struct burn_source {
...
        /** Get the size of the source's data */
        int (*get_size)(struct burn_source *);
...
}

which gets pointed to  file_size()  in file.c which does:
        fstat(fs->datafd, &buf);
        return buf.st_size;
and is used by  burn_track_get_sectors() .


Do i get it right that the write modes of libburn need to 
know the size of the track in advance ?
I read "sao" and "raw". cdrecord needs the size in advance
with these modes.  Up to now i could always use it with -tao,
but Joerg already announced that this might vanish some day.

A while ago i used cdrecord-ProDVD's -sao mode in a pipe
by help of option tsize=... and a filter which pads the
unpredictable stream up to the predicted size. The same
trick should work for libburn.

So if it is not possible to burn a track of unpredicted
length then i would have this wish / proposal :

- an extension of struct burn_source :
      int fixed_size;

- an alternative constructor for  struct burn_source  
  which takes a fixed size as parameter and stores it within
  struct burn_source.
  (If it would accept "-" as pseudo-path of stdin, it would
   be nice.) 
  
- a function  burn_source_get_size  which either returns
  the eventual fixed value or calls  src->get_size

- replacement of all calls t->source->get_size by 
  burn_source_get_size

(- the feeder of stdin is responsible for providing exactly
   the announced fixed size of the stream)

An experimental implementation affected in libburn-0.2/libburn
  libburn.h  file.c  structure.c  source.c
with not much chance to have damaged anything that existed
before ... i hope.
I added an option --fixed_size to libburn-0.2/test/burniso.c 
and just burned successfully via :
  cat x.iso | test/burniso --fixed_size 131198521 -
(where 131198521 is the exact size of file x.iso)


I hope this idea is not too stupid and i hope there aren't
other major obstacles for my wish to burn on the fly.

Is there a chance to get this into libburn ?
Are the maintainers interested in my implementation ?
If yes, in what form ?


Have a nice day :)

Thomas
 


More information about the libburn mailing list