28 #if HAVE_CDIO_PARANOIA_H
29 #include <cdio/cdda.h>
30 #include <cdio/paranoia.h>
31 #elif HAVE_CDIO_PARANOIA_PARANOIA_H
32 #include <cdio/paranoia/cdda.h>
33 #include <cdio/paranoia/paranoia.h>
63 s->
drive = cdio_cddap_identify(ctx->
filename, CDDA_MESSAGE_LOGIT, &err);
72 if ((ret = cdio_cddap_open(s->
drive)) < 0 || !s->
drive->opened) {
77 cdio_cddap_verbose_set(s->
drive, CDDA_MESSAGE_LOGIT, CDDA_MESSAGE_LOGIT);
89 if (s->
drive->bigendianp)
95 if (s->
drive->audio_last_sector != CDIO_INVALID_LSN &&
96 s->
drive->audio_first_sector != CDIO_INVALID_LSN)
98 else if (s->
drive->tracks)
102 for (i = 0; i < s->
drive->tracks; i++) {
104 snprintf(title,
sizeof(title),
"track %02d", s->
drive->disc_toc[i].bTrack);
106 s->
drive->disc_toc[i+1].dwStartSector, title);
128 if (err = cdio_cddap_errors(s->
drive)) {
133 if (err = cdio_cddap_messages(s->
drive)) {
141 memcpy(pkt->
data, buf, CDIO_CD_FRAMESIZE_RAW);
149 cdio_cddap_close(s->
drive);
159 cdio_paranoia_seek(s->
paranoia, timestamp, SEEK_SET);
164 #define OFFSET(x) offsetof(CDIOContext, x)
165 #define DEC AV_OPT_FLAG_DECODING_PARAM
168 {
"paranoia_mode",
"Error recovery mode.",
OFFSET(paranoia_mode),
AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT_MIN, INT_MAX,
DEC,
"paranoia_mode" },
169 {
"verify",
"Verify data integrity in overlap area", 0,
AV_OPT_TYPE_CONST, { .i64 = PARANOIA_MODE_VERIFY }, 0, 0,
DEC,
"paranoia_mode" },
170 {
"overlap",
"Perform overlapped reads.", 0,
AV_OPT_TYPE_CONST, { .i64 = PARANOIA_MODE_OVERLAP }, 0, 0,
DEC,
"paranoia_mode" },
171 {
"neverskip",
"Do not skip failed reads.", 0,
AV_OPT_TYPE_CONST, { .i64 = PARANOIA_MODE_NEVERSKIP }, 0, 0,
DEC,
"paranoia_mode" },
190 .priv_class = &libcdio_class,