[xiph-commits] r15275 - in trunk/cdparanoia: . interface

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Mon Sep 8 17:11:44 PDT 2008


Author: xiphmont
Date: 2008-09-08 17:11:44 -0700 (Mon, 08 Sep 2008)
New Revision: 15275

Modified:
   trunk/cdparanoia/cachetest.c
   trunk/cdparanoia/interface/scsi_interface.c
Log:
Put all tests back online



Modified: trunk/cdparanoia/cachetest.c
===================================================================
--- trunk/cdparanoia/cachetest.c	2008-09-08 22:35:40 UTC (rev 15274)
+++ trunk/cdparanoia/cachetest.c	2008-09-09 00:11:44 UTC (rev 15275)
@@ -35,6 +35,8 @@
 #include "paranoia/cdda_paranoia.h"
 #include "version.h"
 
+#define MIN_SEEK_MS 10
+
 #define reportC(...) {if(progress){fprintf(progress, __VA_ARGS__);}	\
     if(log){fprintf(log, __VA_ARGS__);}}
 #define printC(...) {if(progress){fprintf(progress, __VA_ARGS__);}}
@@ -342,7 +344,7 @@
 	      reportC("\n\tTiming error while performing drive cache checks; aborting test.\n");
 	      return(-1);
 	    }else{
-	      if(cdda_milliseconds(d)<9){
+	      if(cdda_milliseconds(d)<MIN_SEEK_MS){
 		under=1;
 	      }
 	      break;
@@ -429,7 +431,7 @@
 	    reportC("\n\tTiming error while performing drive cache checks; aborting test.\n");
 	    return(-1);
 	  }else{
-	    if(cdda_milliseconds(d)<9)under=1;
+	    if(cdda_milliseconds(d)<MIN_SEEK_MS)under=1;
 	    break;
 	  }
 	}
@@ -518,7 +520,7 @@
 	ret = cdda_read(d,NULL,offset+cachesize+readahead-1,1);
 	if(ret<=0)break;
 	logC("seek=%d:%d:%d",offset+cachesize+readahead-1,ret,cdda_milliseconds(d));
-	if(cdda_milliseconds(d)<9){
+	if(cdda_milliseconds(d)<MIN_SEEK_MS){
 	  under=1;
 	  break;
 	}else if(i&1){
@@ -572,7 +574,7 @@
 	ret = cdda_read(d,NULL,offset+sofar,1);
 	if(ret<=0)break;
 	logC("%d:%d:%d ",sofar,ret,cdda_milliseconds(d));
-	if(cdda_milliseconds(d)>8){
+	if(cdda_milliseconds(d)>=MIN_SEEK_MS){
 	  rollbehind=sofar+1;
 	  break;
 	}
@@ -645,7 +647,7 @@
 	ret = cdda_read(d,NULL,offset+sofar,1);
 	if(ret<=0)break;
 	logC("%d:%d:%d ",offset+sofar,ret,cdda_milliseconds(d));
-	if(cdda_milliseconds(d)>8){
+	if(cdda_milliseconds(d)>=MIN_SEEK_MS){
 	  cachegran=sofar+1;
 	  break;
 	}
@@ -748,7 +750,7 @@
 	ret = cdda_read(d,NULL,loc,1);
 	if(ret<=0)goto error3;
 	logC("%d:%d:%d ",loc,ret,cdda_milliseconds(d));
-	if(cdda_milliseconds(d)<9) fail=1;
+	if(cdda_milliseconds(d)<MIN_SEEK_MS) fail=1;
       }
       continue;
 

Modified: trunk/cdparanoia/interface/scsi_interface.c
===================================================================
--- trunk/cdparanoia/interface/scsi_interface.c	2008-09-08 22:35:40 UTC (rev 15274)
+++ trunk/cdparanoia/interface/scsi_interface.c	2008-09-09 00:11:44 UTC (rev 15275)
@@ -792,7 +792,7 @@
 }
 
 static int scsi_set_speed (cdrom_drive *d, int speed){
-  unsigned char cmd[12]={0xBB, 0, 0, 0, 0xff, 0xff, 0, 0, 0, 0};
+  unsigned char cmd[12]={0xBB, 0, 0, 0, 0xff, 0xff, 0, 0, 0, 0, 0, 0};
   unsigned char sense[SG_MAX_SENSE];
 
   if(speed>=0)
@@ -806,9 +806,9 @@
 
 /* 'abuse' the set read ahead into manipulating the cache */
 static int mmc_cache_clear (cdrom_drive *d, int begin, int sectors){
-  unsigned char cmd[12]={0xA7, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+  unsigned char cmd[12]={0xA7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
   unsigned char sense[SG_MAX_SENSE];
-  int end=begin+sectors;
+  int end=begin+sectors,ret;
   begin--;
 
   if(begin<0)return -1;
@@ -823,7 +823,8 @@
   cmd[8] = (end >> 8) & 0xFF;
   cmd[9] = (end) & 0xFF;
 
-  return handle_scsi_cmd(d,cmd,12,0,0,0,0,sense);
+  ret = handle_scsi_cmd(d,cmd,12,0,0,0,0,sense);
+  return ret;
 }
 
 /* These do one 'extra' copy in the name of clean code */
@@ -1097,6 +1098,7 @@
   retry_count=0;
   
   while(1) {
+
     if((err=map(d,(p?buffer:NULL),begin,sectors,sense))){
       if(d->report_all){
 	char b[256];



More information about the commits mailing list