# HG changeset patch # User faust3 # Date 1131311347 0 # Node ID 7eb9b500dd7fdfc5b1c027e55c74ffd5ee61d207 # Parent 45a58caf19fb60676bab740546145d21192f66ff save us from #ifndef hell diff -r 45a58caf19fb -r 7eb9b500dd7f libmpdemux/cdda.c --- a/libmpdemux/cdda.c Sun Nov 06 19:57:02 2005 +0000 +++ b/libmpdemux/cdda.c Sun Nov 06 21:09:07 2005 +0000 @@ -13,6 +13,11 @@ #include "cdd.h" +#ifndef CD_FRAMESIZE_RAW +#define CD_FRAMESIZE_RAW CDIO_CD_FRAMESIZE_RAW +#endif + + extern char *cdrom_device; static struct cdda_params { @@ -250,17 +255,10 @@ #endif st->priv = priv; -#ifndef HAVE_LIBCDIO st->start_pos = priv->start_sector*CD_FRAMESIZE_RAW; st->end_pos = priv->end_sector*CD_FRAMESIZE_RAW; st->type = STREAMTYPE_CDDA; st->sector_size = CD_FRAMESIZE_RAW; -#else - st->start_pos = priv->start_sector*CDIO_CD_FRAMESIZE_RAW; - st->end_pos = priv->end_sector*CDIO_CD_FRAMESIZE_RAW; - st->type = STREAMTYPE_CDDA; - st->sector_size = CDIO_CD_FRAMESIZE_RAW; -#endif st->fill_buffer = fill_buffer; st->seek = seek; @@ -289,22 +287,13 @@ buf = paranoia_read(p->cdp,cdparanoia_callback); #ifdef WORDS_BIGENDIAN -#ifndef HAVE_LIBCDIO for(i=0;isector++; -#ifndef HAVE_LIBCDIO s->pos = p->sector*CD_FRAMESIZE_RAW; memcpy(buffer,buf,CD_FRAMESIZE_RAW); -#else - s->pos = p->sector*CDIO_CD_FRAMESIZE_RAW; - memcpy(buffer,buf,CDIO_CD_FRAMESIZE_RAW); -#endif if((p->sector < p->start_sector) || (p->sector >= p->end_sector)) { s->eof = 1; @@ -325,11 +314,7 @@ } -#ifndef HAVE_LIBCDIO return CD_FRAMESIZE_RAW; -#else - return CDIO_CD_FRAMESIZE_RAW; -#endif } static int seek(stream_t* s,off_t newpos) { @@ -345,13 +330,8 @@ return 0; } -#ifndef HAVE_LIBCDIO sec = s->pos/CD_FRAMESIZE_RAW; //printf("pos: %d, sec: %d ## %d\n", (int)s->pos, (int)sec, CD_FRAMESIZE_RAW); -#else - sec = s->pos/CDIO_CD_FRAMESIZE_RAW; -//printf("pos: %d, sec: %d ## %d\n", (int)s->pos, (int)sec, CDIO_CD_FRAMESIZE_RAW); -#endif //printf("sector: %d new: %d\n", p->sector, sec ); for(i=0;icd->tracks;i++){ @@ -382,11 +362,7 @@ #endif p->sector = sec; -#ifndef HAVE_LIBCDIO // s->pos = sec*CD_FRAMESIZE_RAW; -#else -// s->pos = sec*CDIO_CD_FRAMESIZE_RAW; -#endif //printf("seek: %d, sec: %d\n", (int)s->pos, sec); paranoia_seek(p->cdp,sec,SEEK_SET);