1222N/A if test "x$msg_cdda" == "xyes"; then
1222N/A PKG_CHECK_MODULES(CDDA, libcdio_paranoia hal >= $HAL_REQUIRED)
6655N/A- AC_DEFINE(HAVE_CDDA, 1, [Define to 1 if CDDA is going to be built])
1222N/A+ AC_DEFINE(HAVE_CDIO, 1, [Define to 1 if CDDA is going to be built with libcdio])
1222N/A+ if test "x$msg_cdda" == "xno"; then
+ AC_DEFINE(HAVE_CDDA, 1, [Define to 1 if CDDA is going to be built])
#define DO_NOT_WANT_PARANOIA_COMPATIBILITY
g_free (cdda_backend->device_path);
cdda_backend->device_path = NULL;
if (cdda_backend->drive != NULL)
cdio_cddap_close (cdda_backend->drive);
cdda_backend->drive = NULL;
+ cdda_backend->device_path = g_strdup_printf ("
/dev/dsk/%s", host);
cdda_backend->device_path = g_strdup_printf ("/dev/%s", host);
find_udi_for_device (cdda_backend);
cdda_backend->drive = cdio_cddap_identify (cdda_backend->device_path, 0, NULL);
if (cdda_backend->drive == NULL)
release_device (cdda_backend);
/* Translator: %s is the device the disc is inserted into */
fuse_name = g_strdup_printf (_("cdda mount on %s"), host);
cdrom_paranoia_t *paranoia;
long size; /* size of file being read */
long header_size; /* size of the header */
* is to avoid seeking back if fewer bytes than whole sector is requested.
long buf_at_sector_num; /* the sector that is cached */
char buf_at_sector[CDIO_CD_FRAMESIZE_RAW]; /* the data of the sector */
free_read_handle (ReadHandle *read_handle)
if (read_handle->paranoia != NULL)
cdio_paranoia_free (read_handle->paranoia);
g_free (read_handle->header);
/* TODO: fill in from metadata */
software = "gvfs-cdda using libcdio " CDIO_VERSION;
+ software = "gvfs-cdda not using libcdio ";
read_handle->first_sector = cdio_cddap_track_firstsector (cdda_backend->drive, track_num);
read_handle->last_sector = cdio_cddap_track_lastsector (cdda_backend->drive, track_num);
read_handle->sector_cursor = -1;
read_handle->buf_at_sector_num = -1;
read_handle->content_size = ((read_handle->last_sector - read_handle->first_sector) + 1) * CDIO_CD_FRAMESIZE_RAW;
read_handle->header = create_header (cdda_backend, &(read_handle->header_size), read_handle->content_size);
read_handle->size = read_handle->header_size + read_handle->content_size;
read_handle->paranoia = cdio_paranoia_init (cdda_backend->drive);
cdio_paranoia_modeset (read_handle->paranoia, PARANOIA_MODE_DISABLE);
cdda_backend->num_open_files++;
/* We have to pass in a callback to paranoia_read, even though we don't use it */
paranoia_callback (long int inpos, paranoia_cb_mode_t function)
cursor_in_stream = read_handle->cursor - read_handle->header_size;
desired_sector = cursor_in_stream / CDIO_CD_FRAMESIZE_RAW + read_handle->first_sector;
if (desired_sector == read_handle->buf_at_sector_num)
skip_bytes = cursor_in_stream - (desired_sector - read_handle->first_sector) * CDIO_CD_FRAMESIZE_RAW;
readbuf = read_handle->buf_at_sector + skip_bytes;
bytes_read = CDIO_CD_FRAMESIZE_RAW - skip_bytes;
//g_warning ("read from cache for cursor @ %ld", read_handle->buf_at_sector_num);
/* first check that we're at the right sector */
if (desired_sector != read_handle->sector_cursor)
cdio_paranoia_seek (read_handle->paranoia, desired_sector, SEEK_SET);
read_handle->sector_cursor = desired_sector;
//g_warning ("seeking cursor to %ld", read_handle->sector_cursor);
skip_bytes = cursor_in_stream - (read_handle->sector_cursor - read_handle->first_sector) * CDIO_CD_FRAMESIZE_RAW;
//g_warning ("advanced cursor to %ld", read_handle->sector_cursor);
readbuf = (char *) cdio_paranoia_read (read_handle->paranoia, paranoia_callback);
read_handle->buf_at_sector_num = read_handle->sector_cursor;
memcpy (read_handle->buf_at_sector, readbuf, CDIO_CD_FRAMESIZE_RAW);
read_handle->sector_cursor++;
bytes_read = CDIO_CD_FRAMESIZE_RAW - skip_bytes;
first = cdio_cddap_track_firstsector (cdda_backend->drive, track_num);
last = cdio_cddap_track_lastsector (cdda_backend->drive, track_num);
content_size = (last - first + 1) * CDIO_CD_FRAMESIZE_RAW;
header = create_header (cdda_backend, &header_size, content_size);
if (track_num > cdda_backend->drive->tracks)
error = g_error_new (G_IO_ERROR, G_IO_ERROR_NOT_FOUND, _("File doesn't exist"));
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
if (! cdio_cddap_track_audiop (cdda_backend->drive, track_num))
error = g_error_new (G_IO_ERROR, G_IO_ERROR_NOT_FOUND, _("The file does not exist or isn't an audio track"));
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
set_info_for_track (cdda_backend, info, track_num);
//g_warning ("enumerate (%s)", filename);
for (n = 1; n <= cdda_backend->drive->tracks; n++)
l = g_list_append (l, info);
g_vfs_job_succeeded (G_VFS_JOB (job));
Exec=@libexecdir@/gvfsd-cdda