Looked at WAV spec format. Probably (but I'm not certain) the thing

that was wrong was the test program which needs to byte swap. What
confuses me now is how the media players sort this out.
This commit is contained in:
rocky
2005-01-14 04:09:30 +00:00
parent 165363409d
commit deaa91326f
2 changed files with 26 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
/* /*
$Id: interface.c,v 1.11 2005/01/14 03:41:11 rocky Exp $ $Id: interface.c,v 1.12 2005/01/14 04:09:30 rocky Exp $
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
Copyright (C) 1998 Monty xiphmont@mit.edu Copyright (C) 1998 Monty xiphmont@mit.edu
@@ -111,15 +111,7 @@ cdda_open(cdrom_drive_t *d)
/* d->select_speed(d,d->maxspeed); most drives are full speed by default */ /* d->select_speed(d,d->maxspeed); most drives are full speed by default */
if (d->bigendianp==-1) if (d->bigendianp==-1)
#ifdef USE_DATA_BIGENDIANP
d->bigendianp=data_bigendianp(d); d->bigendianp=data_bigendianp(d);
#else
#if WORDS_BIGENDIAN
d->bigendianp=1;
#else
d->bigendianp=0;
#endif /*WORDS_BIGENDIAN*/
#endif /*USE_DATA_BIGENDIANP*/
return(0); return(0);
} }

View File

@@ -34,6 +34,12 @@
#include <string.h> #include <string.h>
#endif #endif
#ifdef WORDS_BIGENDIAN
#define BIGENDIAN 1
#else
#define BIGENDIAN 0
#endif
#define SKIP_TEST_RC 77 #define SKIP_TEST_RC 77
#define MAX_SECTORS 50 #define MAX_SECTORS 50
@@ -133,12 +139,26 @@ main(int argc, const char *argv[])
if ( PARANOIA_CB_READ == audio_status[i] || if ( PARANOIA_CB_READ == audio_status[i] ||
PARANOIA_CB_VERIFY == audio_status[i] ) { PARANOIA_CB_VERIFY == audio_status[i] ) {
/* We read the block via paranoia without an error. */ /* We read the block via paranoia without an error. */
if ( 0 == cdio_read_audio_sector(d->p_cdio, readbuf, i_lsn) ) { if ( 0 == cdio_read_audio_sector(d->p_cdio, readbuf, i_lsn) ) {
if ( 0 != memcmp(audio_buf[i], readbuf, if ( BIGENDIAN != d->bigendianp ) {
CDIO_CD_FRAMESIZE_RAW) ) { /* We will compare in the slow, pedantic way*/
printf("LSN %ld doesn't match\n", (long int) i_lsn); int j;
i_rc = 1; for (j=0; j < CDIO_CD_FRAMESIZE_RAW ; j +=2) {
goto out; if (audio_buf[i][j] != readbuf[j+1] &&
audio_buf[i][j+1] != readbuf[j] ) {
printf("LSN %ld doesn't match\n", (long int) i_lsn);
i_rc = 1;
goto out;
}
}
} else {
if ( 0 != memcmp(audio_buf[i], readbuf,
CDIO_CD_FRAMESIZE_RAW) ) {
printf("LSN %ld doesn't match\n", (long int) i_lsn);
i_rc = 1;
goto out;
}
} }
} }
} else { } else {