/[debburn]/cdrkit/trunk/icedax/icedax.c
ViewVC logotype

Diff of /cdrkit/trunk/icedax/icedax.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 422 by blade, Thu Nov 23 09:58:31 2006 UTC revision 430 by blade, Thu Nov 23 18:57:28 2006 UTC
# Line 106  static char     sccsid[] = Line 106  static char     sccsid[] =
106  #endif  #endif
107  #include <vadefs.h>  #include <vadefs.h>
108    
109  #include <scg/scsitransp.h>  #include <usal/scsitransp.h>
110    
111  #ifdef  HAVE_AREAS  #ifdef  HAVE_AREAS
112  #include <be/kernel/OS.h>  #include <be/kernel/OS.h>
# Line 632  static void OpenAudio(char *fname, doubl Line 632  static void OpenAudio(char *fname, doubl
632    
633  #include "scsi_cmds.h"  #include "scsi_cmds.h"
634    
635  static int RealEnd(SCSI *scgp, UINT4 *buff);  static int RealEnd(SCSI *usalp, UINT4 *buff);
636    
637  static int RealEnd(SCSI *scgp, UINT4 *buff)  static int RealEnd(SCSI *usalp, UINT4 *buff)
638  {  {
639          if (scg_cmd_err(scgp) != 0) {          if (usal_cmd_err(usalp) != 0) {
640                  int c,k,q;                  int c,k,q;
641    
642                  k = scg_sense_key(scgp);                  k = usal_sense_key(usalp);
643                  c = scg_sense_code(scgp);                  c = usal_sense_code(usalp);
644                  q = scg_sense_qual(scgp);                  q = usal_sense_qual(usalp);
645                  if ((k == 0x05 /* ILLEGAL_REQUEST */ &&                  if ((k == 0x05 /* ILLEGAL_REQUEST */ &&
646                       c == 0x21 /* lba out of range */ &&                       c == 0x21 /* lba out of range */ &&
647                       q == 0x00) ||                       q == 0x00) ||
# Line 655  static int RealEnd(SCSI *scgp, UINT4 *bu Line 655  static int RealEnd(SCSI *scgp, UINT4 *bu
655                  }                  }
656          }          }
657    
658          if (scg_getresid(scgp) > 16) return 1;          if (usal_getresid(usalp) > 16) return 1;
659    
660          {          {
661                  unsigned char *p;                  unsigned char *p;
# Line 1056  static void exit_wrapper(int status) Line 1056  static void exit_wrapper(int status)
1056  #endif  #endif
1057    
1058          if (child_pid != 0) {          if (child_pid != 0) {
1059                  SCSI *scgp = get_scsi_p();                  SCSI *usalp = get_scsi_p();
1060                  if (scgp->running) {                  if (usalp->running) {
1061                          scgp->cb_fun = on_exitscsi;                          usalp->cb_fun = on_exitscsi;
1062                          scgp->cb_arg = (void *)status;                          usalp->cb_arg = (void *)status;
1063                  } else {                  } else {
1064                          on_exitscsi((void *)status);                          on_exitscsi((void *)status);
1065                  }                  }
# Line 1365  static int do_read(myringbuff *p, unsign Line 1365  static int do_read(myringbuff *p, unsign
1365    
1366                  retry_count = 0;                  retry_count = 0;
1367                  do {                  do {
1368                          SCSI *scgp = get_scsi_p();                          SCSI *usalp = get_scsi_p();
1369                          int retval;                          int retval;
1370  #ifdef DEBUG_READS  #ifdef DEBUG_READS
1371  fprintf(stderr, "reading from %lu to %lu, overlap %u\n", lSector, lSector + SectorBurst -1, global.overlap);  fprintf(stderr, "reading from %lu to %lu, overlap %u\n", lSector, lSector + SectorBurst -1, global.overlap);
# Line 1384  if (((unsigned)p->data) & (global.pagesi Line 1384  if (((unsigned)p->data) & (global.pagesi
1384    
1385                                  /* we switch to single sector reads,                                  /* we switch to single sector reads,
1386                                   * in order to handle the remaining sectors. */                                   * in order to handle the remaining sectors. */
1387                                  scgp->silent++;                                  usalp->silent++;
1388                                  do {                                  do {
1389                                          int retval2 = ReadCdRomSub( scgp, bufferSub, lSector+singles, 1 );                                          int retval2 = ReadCdRomSub( usalp, bufferSub, lSector+singles, 1 );
1390                                          *eorecording = RealEnd( scgp, bufferSub );                                          *eorecording = RealEnd( usalp, bufferSub );
1391                                          if (*eorecording) {                                          if (*eorecording) {
1392                                                  break;                                                  break;
1393                                          }                                          }
1394                                          memcpy(p->data+singles*CD_FRAMESAMPLES, bufferSub, CD_FRAMESIZE_RAW);                                          memcpy(p->data+singles*CD_FRAMESAMPLES, bufferSub, CD_FRAMESIZE_RAW);
1395                                          singles++;                                          singles++;
1396                                  } while (singles < SectorBurst);                                  } while (singles < SectorBurst);
1397                                  scgp->silent--;                                  usalp->silent--;
1398    
1399                                  if ( *eorecording ) {                                  if ( *eorecording ) {
1400                                          patch_real_end(lSector+singles);                                          patch_real_end(lSector+singles);
# Line 1413  global.iloop, *nSamplesToDo); Line 1413  global.iloop, *nSamplesToDo);
1413    
1414                                  }                                  }
1415                          } else {                          } else {
1416                                  retval = ReadCdRom( scgp, p->data, lSector, SectorBurst );                                  retval = ReadCdRom( usalp, p->data, lSector, SectorBurst );
1417                          }                          }
1418                          handle_inputendianess(p->data, SectorBurst * CD_FRAMESAMPLES);                          handle_inputendianess(p->data, SectorBurst * CD_FRAMESAMPLES);
1419                          if (NULL ==                          if (NULL ==

Legend:
Removed from v.422  
changed lines
  Added in v.430

  ViewVC Help
Powered by ViewVC 1.1.5