Hello! I'm a little programmer on linux and I've thinked about a patch over cdrecord to make it accept real-time created tracks. I've worked onto cdrecord 1.8a24 and the patch is created for this version only. Ok, let's talk about all that...
First of all here's how it works. The patched cdrecord accepts now a now kind of option for the track: filter=xxx, where xxx is a module filename. The module is a user-created one. It must have four functions in order to be a valid cdrecord-filter. Here's the four functions:
int TrackInit(char * arg)
int TrackType(int fd)
int TrackSize(int fd)
int TrackRead(int fd, void * buf, size_t count)
TrackInit is given the argument provided by the command line, and must return a handle exactly as the open function. The handle must be greater than 2, because of the standard streams. It must check if the track can be correctly proceeded and readed. If returned -1 then an error will be considered as an error.
TrackType is given a handle returned from TrackInit and should return a constant describing the type of the filtered-track. 0 is audio, 1 data, 2 xa1, 3 xa2 and 4 cdi.
TrackSize is given a handle returned from TrackInit and should compute the size of the filtered-track in bytes.
TrackRead works exactly as the read function. It should fill the buffer of count bytes of data readed from the handle fd and should return the number of bytes actually readed.
An additionnal void _init(void) function can be present. It will be called the first time the module is loaded, and can be used for some variables initialisations.
Into the package I've included two filters I've created. The first one
is a dummy filter that can just be used for a tutorial purpose. The second
one is an mp3 filter. It's based onto mpglib from Michael Hipp. It
can read and decompress mp3 files on-the-fly and write them as an audio
track. It's badly programmed but it works.
Well, here's the packages of cdrecord-filters. It contains a patch for
cdrecord 1.8a24 and the filters I've discribed. Ok ok, it's the version 1.0.1,
the 1.0.0 *HAD* a bug. A very little bug in fact but...
cdrecord-filters package for cdrecord-1.8a24
Here's the patched cdrecord for the ones that can't get how to get cdrecord
patched for the filters.
cdrecord-1.8a24 already patched.
You can write me for any comment, question or feedback: pixels@multimania.com
Ok now it's time to wish you best of luck with all that stuff!
![]()