I have this probably unexpected suggestion - why not use libcdio as a backend
for cdda input plugin. Digital extraction from Audio CDs seems to a long solved
and sufficiently easy/small problem, but there is something to this suggestion,
I hope :-)
- xine-lib already includes a copy of libcdio in its sources or can optionally
use external libcdio installation;
- it's conceptually better to re-use existing functionality rather than
reinventing the bicycle; especially given that libcdio is specialized in this area;
- less work in the future should OS-specific Audio CD interfaces change;
- less work now to fully support currently supported platforms.
In the last item I specifically mean that xine-lib currently doesn't support
FreeBSD /dev/cdX interface, it supports only /dev/acdX.
To clarify, in FreeBSD cdX is a device for SCSI devices, SATA devices when ahci
driver is used, SATA/STAPI devices wrapped with atapicam or ATA_CAM. acdX is an
interface to plain/legacy ATAPI devices with old drivers.
libcdio does support both FreeBSD interfaces.
There could also be benefits for other OSes, but I haven't examined that.
Here is a rough patch that I came up with:
The patch actually works, but I produced it mostly to demonstrate the idea.
If either internal or external cdio is made a requirement, then the existing
OS-specific code could probably be dropped completely.
Some explanations for the patch, just in case:
- add read_cdrom_toc() and read_cdrom_frames() implementations that use libcdio
- universally use cdda_input_plugin_t* as the first argument to read_cdrom_toc
- this removes ifdef in the calling code and adds this_gen->fd dereference
- cdda_open => _cdda_open, cdda_close => _cdda_close to avoid name conflict with
libcdio headers (cdparanoia compatibility names)
The patch doesn't include the changes to makefiles that are needed to link cdda
input plugin with cdio libraries (-lcdio_cdda). I actually made a rather ugly
hack for that, being lazy to a produce proper autotools change.
What do you think about this suggestion?
Get latest updates about Open Source Projects, Conferences and News.