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:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,7 +139,20 @@ 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 ( BIGENDIAN != d->bigendianp ) {
|
||||||
|
/* We will compare in the slow, pedantic way*/
|
||||||
|
int j;
|
||||||
|
for (j=0; j < CDIO_CD_FRAMESIZE_RAW ; j +=2) {
|
||||||
|
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,
|
if ( 0 != memcmp(audio_buf[i], readbuf,
|
||||||
CDIO_CD_FRAMESIZE_RAW) ) {
|
CDIO_CD_FRAMESIZE_RAW) ) {
|
||||||
printf("LSN %ld doesn't match\n", (long int) i_lsn);
|
printf("LSN %ld doesn't match\n", (long int) i_lsn);
|
||||||
@@ -141,6 +160,7 @@ main(int argc, const char *argv[])
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
printf("Skipping LSN %ld because of status: %s\n",
|
printf("Skipping LSN %ld because of status: %s\n",
|
||||||
(long int) i_lsn, paranoia_cb_mode2str[audio_status[i]]);
|
(long int) i_lsn, paranoia_cb_mode2str[audio_status[i]]);
|
||||||
|
|||||||
Reference in New Issue
Block a user