- msg_Err( p_access, "could not read sector %lu",
- (long unsigned int) p_cdda->i_lsn );
- block_Release( p_block );
-
- /* If we had problems above, assume the problem is with
- the first sector of the read and set to skip it. In
- the future libcdio may have cdparanoia support.
- */
- p_cdda->i_lsn++;
- p_access->info.i_pos += CDIO_CD_FRAMESIZE_RAW;
- return NULL;
+#if LIBCDIO_VERSION_NUM >= 72
+ driver_return_code_t rc = DRIVER_OP_SUCCESS;
+
+ if ( p_cdda->b_paranoia_enabled )
+ {
+ int i;
+ for( i = 0; i < i_blocks; i++ )
+ {
+ int16_t *p_readbuf=paranoia_read(p_cdda->paranoia, NULL);
+ char *psz_err=cdio_cddap_errors(p_cdda->paranoia_cd);
+ char *psz_mes=cdio_cddap_messages(p_cdda->paranoia_cd);
+
+ if (psz_mes || psz_err)
+ msg_Err( p_access, "%s%s\n", psz_mes ? psz_mes: "",
+ psz_err ? psz_err: "" );
+
+ if (psz_err) free(psz_err);
+ if (psz_mes) free(psz_mes);
+ if( !p_readbuf ) {
+ msg_Err( p_access, "paranoia read error on frame %i\n",
+ p_cdda->i_lsn+i );
+ } else
+ memcpy(p_block + i * CDIO_CD_FRAMESIZE_RAW, p_readbuf,
+ CDIO_CD_FRAMESIZE_RAW);
+ }
+ }
+ else
+ rc = cdio_read_audio_sectors( p_cdda->p_cdio, p_block->p_buffer,
+ p_cdda->i_lsn, i_blocks);
+#else
+#define DRIVER_OP_SUCCESS 0
+ int rc;
+ rc = cdio_read_audio_sectors( p_cdda->p_cdio, p_block->p_buffer,
+ p_cdda->i_lsn, i_blocks);
+#endif
+ if( rc != DRIVER_OP_SUCCESS )
+ {
+ msg_Err( p_access, "could not read %d sectors starting from %lu",
+ i_blocks, (long unsigned int) p_cdda->i_lsn );
+ block_Release( p_block );
+
+ /* If we had problems above, assume the problem is with
+ the first sector of the read and set to skip it. In
+ the future libcdio may have cdparanoia support.
+ */
+ p_cdda->i_lsn++;
+ p_access->info.i_pos += CDIO_CD_FRAMESIZE_RAW;
+ return NULL;
+ }