From 5223b29276d18a478cdc1a9a1fe2de23128b9e84 Mon Sep 17 00:00:00 2001 From: edsdead Date: Wed, 19 Mar 2008 04:38:52 +0000 Subject: [PATCH] remove 272 byte offset that emulated 68 sample read offset in author's drive --- lib/driver/image/bincue.c | 27 ++----- lib/driver/image/cdrdao.c | 27 ++----- test/cdda-read.right | 150 +++++++++++++++++++------------------- test/check_paranoia.sh.in | 6 +- 4 files changed, 92 insertions(+), 118 deletions(-) diff --git a/lib/driver/image/bincue.c b/lib/driver/image/bincue.c index c101b9be..ab5ef77f 100644 --- a/lib/driver/image/bincue.c +++ b/lib/driver/image/bincue.c @@ -1,5 +1,5 @@ /* - $Id: bincue.c,v 1.20 2008/03/16 00:12:43 rocky Exp $ + $Id: bincue.c,v 1.21 2008/03/19 04:38:52 edsdead Exp $ Copyright (C) 2002, 2003, 2004, 2005, 2006 Rocky Bernstein @@ -27,7 +27,7 @@ (*.cue). */ -static const char _rcsid[] = "$Id: bincue.c,v 1.20 2008/03/16 00:12:43 rocky Exp $"; +static const char _rcsid[] = "$Id: bincue.c,v 1.21 2008/03/19 04:38:52 edsdead Exp $"; #include "image.h" #include "cdio_assert.h" @@ -793,25 +793,12 @@ _read_audio_sectors_bincue (void *p_user_data, void *data, lsn_t lsn, _img_private_t *p_env = p_user_data; int ret; - /* Why the adjustment of 272, I don't know. It seems to work though */ - if (lsn != 0) { - ret = cdio_stream_seek (p_env->gen.data_source, - (lsn * CDIO_CD_FRAMESIZE_RAW) - 272, SEEK_SET); - if (ret!=0) return ret; + ret = cdio_stream_seek (p_env->gen.data_source, + lsn * CDIO_CD_FRAMESIZE_RAW, SEEK_SET); + if (ret!=0) return ret; - ret = cdio_stream_read (p_env->gen.data_source, data, - CDIO_CD_FRAMESIZE_RAW, nblocks); - } else { - /* We need to pad out the first 272 bytes with 0's */ - BZERO(data, 272); - - ret = cdio_stream_seek (p_env->gen.data_source, 0, SEEK_SET); - - if (ret!=0) return ret; - - ret = cdio_stream_read (p_env->gen.data_source, (uint8_t *) data+272, - CDIO_CD_FRAMESIZE_RAW - 272, nblocks); - } + ret = cdio_stream_read (p_env->gen.data_source, data, + CDIO_CD_FRAMESIZE_RAW, nblocks); /* ret is number of bytes if okay, but we need to return 0 okay. */ return ret == 0; diff --git a/lib/driver/image/cdrdao.c b/lib/driver/image/cdrdao.c index f31ad6f5..973f3b49 100644 --- a/lib/driver/image/cdrdao.c +++ b/lib/driver/image/cdrdao.c @@ -1,5 +1,5 @@ /* - $Id: cdrdao.c,v 1.24 2008/03/16 00:12:43 rocky Exp $ + $Id: cdrdao.c,v 1.25 2008/03/19 04:38:52 edsdead Exp $ Copyright (C) 2004, 2005, 2006, 2007 Rocky Bernstein toc reading routine adapted from cuetools @@ -25,7 +25,7 @@ (*.cue). */ -static const char _rcsid[] = "$Id: cdrdao.c,v 1.24 2008/03/16 00:12:43 rocky Exp $"; +static const char _rcsid[] = "$Id: cdrdao.c,v 1.25 2008/03/19 04:38:52 edsdead Exp $"; #include "image.h" #include "cdio_assert.h" @@ -975,25 +975,12 @@ _read_audio_sectors_cdrdao (void *user_data, void *data, lsn_t lsn, _img_private_t *env = user_data; int ret; - /* Why the adjustment of 272, I don't know. It seems to work though */ - if (lsn != 0) { - ret = cdio_stream_seek (env->tocent[0].data_source, - (lsn * CDIO_CD_FRAMESIZE_RAW) - 272, SEEK_SET); - if (ret!=0) return ret; + ret = cdio_stream_seek (env->tocent[0].data_source, + lsn * CDIO_CD_FRAMESIZE_RAW, SEEK_SET); + if (ret!=0) return ret; - ret = cdio_stream_read (env->tocent[0].data_source, data, - CDIO_CD_FRAMESIZE_RAW, nblocks); - } else { - /* We need to pad out the first 272 bytes with 0's */ - BZERO(data, 272); - - ret = cdio_stream_seek (env->tocent[0].data_source, 0, SEEK_SET); - - if (ret!=0) return ret; - - ret = cdio_stream_read (env->tocent[0].data_source, (uint8_t *) data+272, - CDIO_CD_FRAMESIZE_RAW - 272, nblocks); - } + ret = cdio_stream_read (env->tocent[0].data_source, data, + CDIO_CD_FRAMESIZE_RAW, nblocks); /* ret is number of bytes if okay, but we need to return 0 okay. */ return ret == 0; diff --git a/test/cdda-read.right b/test/cdda-read.right index c445ce1f..e5e583ea 100644 --- a/test/cdda-read.right +++ b/test/cdda-read.right @@ -73,79 +73,79 @@ PARTICULAR PURPOSE. 0x0450: 0000 0000 0000 0000 0000 0000 0000 0000 0x0460: 0000 0000 0000 0000 0000 0000 0000 0000 0x0470: 0000 0000 0000 0000 0000 0000 0000 0000 -0x0480: 0000 0000 0000 0000 0000 0000 0000 0000 -0x0490: 0000 0000 0000 0000 0000 0000 0000 0000 -0x04a0: 0000 0000 0000 0000 0000 0000 0000 0000 -0x04b0: 0000 0000 0000 0000 0000 0000 0000 0000 -0x04c0: 0000 0000 0000 0000 0000 0000 0000 0000 -0x04d0: 0000 0000 0000 0000 0000 0000 0000 0000 -0x04e0: 0000 0000 0000 0000 0000 0000 0000 0000 -0x04f0: 0000 0000 0000 0000 0000 0000 0000 0000 -0x0500: 0000 0000 0000 0000 0000 0000 0000 0000 -0x0510: 0000 0000 0000 0000 0000 0000 0000 0000 -0x0520: 0000 0000 0000 0000 0000 0000 0000 0000 -0x0530: 0000 0000 0000 0000 0000 0000 0000 0000 -0x0540: 0000 0000 0000 0000 0000 0000 0000 0000 -0x0550: 0000 0000 0000 0000 0000 0000 0000 0000 -0x0560: 0000 0000 0000 0000 0000 0000 0000 0000 -0x0570: 0000 0000 0000 0000 0000 0000 0000 0000 -0x0580: 0000 0000 0000 0000 0000 0000 0000 0000 -0x0590: 0000 0000 0000 0000 f0ff 0000 f0ff 0000 -0x05a0: e3ff f0ff e3ff f0ff d8ff e3ff d8ff e3ff -0x05b0: dfff e8ff dfff e8ff f5ff fcff f5ff fcff -0x05c0: 0700 0c00 0700 0c00 1500 1800 1500 1800 -0x05d0: 2000 1100 2000 1100 2800 0b00 2800 0b00 -0x05e0: 1d00 0500 1d00 0500 1300 0000 1300 0000 -0x05f0: 0a00 0b00 0a00 0b00 1200 1300 1200 1300 -0x0600: 1800 1900 1800 1900 0c00 0d00 0c00 0d00 -0x0610: 0200 0300 0200 0300 e9ff faff e9ff faff -0x0620: d5ff f2ff d5ff f2ff b5ff dbff b5ff dbff -0x0630: 9cff c8ff 9cff c8ff a9ff c9ff a9ff c9ff -0x0640: c4ff daff c4ff daff eaff f8ff eaff f8ff -0x0650: 1900 1000 1900 1000 3e00 2300 3e00 2300 -0x0660: 6b00 3100 6b00 3100 8d00 3b00 8d00 3b00 -0x0670: 7600 4200 7600 4200 6100 3600 6100 3600 -0x0680: 3e00 2b00 3e00 2b00 1000 1100 1000 1100 -0x0690: eaff fbff eaff fbff cbff e9ff cbff e9ff -0x06a0: b2ff daff b2ff daff ceff deff ceff deff -0x06b0: e5ff f1ff e5ff f1ff f8ff 0000 f8ff 0000 -0x06c0: 0700 0c00 0700 0c00 1300 1500 1300 1500 -0x06d0: 0c00 0b00 0c00 0b00 e6ff f2ff e6ff f2ff -0x06e0: c7ff ddff c7ff ddff aeff ccff aeff ccff -0x06f0: 8aff bfff 8aff bfff 6eff b5ff 6eff b5ff -0x0700: 99ff ceff 99ff ceff d0ff e3ff d0ff e3ff -0x0710: 0e00 0400 0e00 0400 8000 3e00 8000 3e00 -0x0720: da00 6c00 da00 6c00 1f01 8f00 1f01 8f00 -0x0730: 4201 a900 4201 a900 2901 9b00 2901 9b00 -0x0740: d000 6d00 d000 6d00 7100 3500 7100 3500 -0x0750: 0000 0600 0000 0600 64ff bfff 64ff bfff -0x0760: e7fe 86ff e7fe 86ff a7fe 59ff a7fe 59ff -0x0770: 98fe 47ff 98fe 47ff b1fe 4bff b1fe 4bff -0x0780: eafe 71ff eafe 71ff 5cff a2ff 5cff a2ff -0x0790: ceff ebff ceff ebff 3c00 2600 3c00 2600 -0x07a0: 9400 5500 9400 5500 d900 7900 d900 7900 -0x07b0: bd00 6400 bd00 6400 a300 5100 a300 5100 -0x07c0: 5f00 3000 5f00 3000 1300 1400 1300 1400 -0x07d0: 0700 fcff 0700 fcff 0d00 f8ff 0d00 f8ff -0x07e0: 1100 0400 1100 0400 4300 1d00 4300 1d00 -0x07f0: 6a00 3000 6a00 3000 8800 3e00 8800 3e00 -0x0800: 8e00 4800 8e00 4800 6000 2f00 6000 2f00 -0x0810: e9ff f9ff e9ff f9ff 88ff cdff 88ff cdff -0x0820: 3bff 9aff 3bff 9aff ecfe 72ff ecfe 72ff -0x0830: d2fe 63ff d2fe 63ff 01ff 79ff 01ff 79ff -0x0840: 2bff 8cff 2bff 8cff 83ff bdff 83ff bdff -0x0850: fcff f5ff fcff f5ff 5e00 3200 5e00 3200 -0x0860: ac00 6200 ac00 6200 e800 8700 e800 8700 -0x0870: 0501 8200 0501 8200 d800 6b00 d800 6b00 -0x0880: 9d00 5600 9d00 5600 6a00 4300 6a00 4300 -0x0890: 3e00 2200 3e00 2200 1900 0600 1900 0600 -0x08a0: eaff efff eaff efff e4ff ecff e4ff ecff -0x08b0: dfff e9ff dfff e9ff bbff e6ff bbff e6ff -0x08c0: 9eff d3ff 9eff d3ff 77ff c4ff 77ff c4ff -0x08d0: 39ff a8ff 39ff a8ff 19ff 92ff 19ff 92ff -0x08e0: 22ff 91ff 22ff 91ff 5cff b1ff 5cff b1ff -0x08f0: cdff ecff cdff ecff 7500 3c00 7500 3c00 -0x0900: 1101 8c00 1101 8c00 8b01 ca00 8b01 ca00 -0x0910: e701 f900 e701 f900 da01 fb00 da01 fb00 -0x0920: 6401 b800 6401 b800 8a00 4500 8a00 4500 +0x0480: 0000 0000 0000 0000 f0ff 0000 f0ff 0000 +0x0490: e3ff f0ff e3ff f0ff d8ff e3ff d8ff e3ff +0x04a0: dfff e8ff dfff e8ff f5ff fcff f5ff fcff +0x04b0: 0700 0c00 0700 0c00 1500 1800 1500 1800 +0x04c0: 2000 1100 2000 1100 2800 0b00 2800 0b00 +0x04d0: 1d00 0500 1d00 0500 1300 0000 1300 0000 +0x04e0: 0a00 0b00 0a00 0b00 1200 1300 1200 1300 +0x04f0: 1800 1900 1800 1900 0c00 0d00 0c00 0d00 +0x0500: 0200 0300 0200 0300 e9ff faff e9ff faff +0x0510: d5ff f2ff d5ff f2ff b5ff dbff b5ff dbff +0x0520: 9cff c8ff 9cff c8ff a9ff c9ff a9ff c9ff +0x0530: c4ff daff c4ff daff eaff f8ff eaff f8ff +0x0540: 1900 1000 1900 1000 3e00 2300 3e00 2300 +0x0550: 6b00 3100 6b00 3100 8d00 3b00 8d00 3b00 +0x0560: 7600 4200 7600 4200 6100 3600 6100 3600 +0x0570: 3e00 2b00 3e00 2b00 1000 1100 1000 1100 +0x0580: eaff fbff eaff fbff cbff e9ff cbff e9ff +0x0590: b2ff daff b2ff daff ceff deff ceff deff +0x05a0: e5ff f1ff e5ff f1ff f8ff 0000 f8ff 0000 +0x05b0: 0700 0c00 0700 0c00 1300 1500 1300 1500 +0x05c0: 0c00 0b00 0c00 0b00 e6ff f2ff e6ff f2ff +0x05d0: c7ff ddff c7ff ddff aeff ccff aeff ccff +0x05e0: 8aff bfff 8aff bfff 6eff b5ff 6eff b5ff +0x05f0: 99ff ceff 99ff ceff d0ff e3ff d0ff e3ff +0x0600: 0e00 0400 0e00 0400 8000 3e00 8000 3e00 +0x0610: da00 6c00 da00 6c00 1f01 8f00 1f01 8f00 +0x0620: 4201 a900 4201 a900 2901 9b00 2901 9b00 +0x0630: d000 6d00 d000 6d00 7100 3500 7100 3500 +0x0640: 0000 0600 0000 0600 64ff bfff 64ff bfff +0x0650: e7fe 86ff e7fe 86ff a7fe 59ff a7fe 59ff +0x0660: 98fe 47ff 98fe 47ff b1fe 4bff b1fe 4bff +0x0670: eafe 71ff eafe 71ff 5cff a2ff 5cff a2ff +0x0680: ceff ebff ceff ebff 3c00 2600 3c00 2600 +0x0690: 9400 5500 9400 5500 d900 7900 d900 7900 +0x06a0: bd00 6400 bd00 6400 a300 5100 a300 5100 +0x06b0: 5f00 3000 5f00 3000 1300 1400 1300 1400 +0x06c0: 0700 fcff 0700 fcff 0d00 f8ff 0d00 f8ff +0x06d0: 1100 0400 1100 0400 4300 1d00 4300 1d00 +0x06e0: 6a00 3000 6a00 3000 8800 3e00 8800 3e00 +0x06f0: 8e00 4800 8e00 4800 6000 2f00 6000 2f00 +0x0700: e9ff f9ff e9ff f9ff 88ff cdff 88ff cdff +0x0710: 3bff 9aff 3bff 9aff ecfe 72ff ecfe 72ff +0x0720: d2fe 63ff d2fe 63ff 01ff 79ff 01ff 79ff +0x0730: 2bff 8cff 2bff 8cff 83ff bdff 83ff bdff +0x0740: fcff f5ff fcff f5ff 5e00 3200 5e00 3200 +0x0750: ac00 6200 ac00 6200 e800 8700 e800 8700 +0x0760: 0501 8200 0501 8200 d800 6b00 d800 6b00 +0x0770: 9d00 5600 9d00 5600 6a00 4300 6a00 4300 +0x0780: 3e00 2200 3e00 2200 1900 0600 1900 0600 +0x0790: eaff efff eaff efff e4ff ecff e4ff ecff +0x07a0: dfff e9ff dfff e9ff bbff e6ff bbff e6ff +0x07b0: 9eff d3ff 9eff d3ff 77ff c4ff 77ff c4ff +0x07c0: 39ff a8ff 39ff a8ff 19ff 92ff 19ff 92ff +0x07d0: 22ff 91ff 22ff 91ff 5cff b1ff 5cff b1ff +0x07e0: cdff ecff cdff ecff 7500 3c00 7500 3c00 +0x07f0: 1101 8c00 1101 8c00 8b01 ca00 8b01 ca00 +0x0800: e701 f900 e701 f900 da01 fb00 da01 fb00 +0x0810: 6401 b800 6401 b800 8a00 4500 8a00 4500 +0x0820: 92ff c4ff 92ff c4ff 8efe 4cff 8efe 4cff +0x0830: a6fd cdfe a6fd cdfe 09fd 7afe 09fd 7afe +0x0840: 21fd 8cfe 21fd 8cfe 9dfd d2fe 9dfd d2fe +0x0850: b3fe 67ff b3fe 67ff 3000 1600 3000 1600 +0x0860: e801 e800 e801 e800 4503 8f01 4503 8f01 +0x0870: 3004 2102 3004 2102 2404 1f02 2404 1f02 +0x0880: 4f03 a201 4f03 a201 b801 cf00 b801 cf00 +0x0890: e4ff e4ff e4ff e4ff bafd d7fe bafd d7fe +0x08a0: 00fc 01fe 00fc 01fe 60fb abfd 60fb abfd +0x08b0: 5efb 9cfd 5efb 9cfd 32fc 11fe 32fc 11fe +0x08c0: d5fd c7fe d5fd c7fe 0100 0e00 0100 0e00 +0x08d0: 0102 1701 0102 1701 9803 e901 9803 e901 +0x08e0: d404 8b02 d404 8b02 ea04 8f02 ea04 8f02 +0x08f0: d803 fc01 d803 fc01 4802 2a01 4802 2a01 +0x0900: 2100 0e00 2100 0e00 20fe 07ff 20fe 07ff +0x0910: 86fc 35fe 86fc 35fe acfb c3fd acfb c3fd +0x0920: c0fb ddfd c0fb ddfd b5fc 40fe b5fc 40fe diff --git a/test/check_paranoia.sh.in b/test/check_paranoia.sh.in index 370d93e5..33101f40 100644 --- a/test/check_paranoia.sh.in +++ b/test/check_paranoia.sh.in @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: check_paranoia.sh.in,v 1.15 2008/03/08 18:11:11 rocky Exp $ +# $Id: check_paranoia.sh.in,v 1.16 2008/03/19 04:38:52 edsdead Exp $ # Compare our cd-paranoia with known good results. if test "X$srcdir" = "X" ; then @@ -19,8 +19,8 @@ if test "@CMP@" != no -a "@BUILD_CD_PARANOIA_TRUE@"X = X ; then if test $? -ne 0 ; then exit 6 fi - dd bs=16 skip=17 if=cdda.raw of=cdda-1.raw - dd bs=16 if=cdda.bin of=cdda-2.raw count=44377 + dd bs=16 if=cdda.raw of=cdda-1.raw + dd bs=16 if=cdda.bin of=cdda-2.raw count=44394 if @CMP@ cdda-1.raw cdda-2.raw ; then echo "** Raw cdda.bin extraction okay" else