[BACK]Return to rip.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / cdio

Diff for /src/usr.bin/cdio/rip.c between version 1.16 and 1.17

version 1.16, 2015/08/20 22:32:41 version 1.17, 2017/12/23 20:04:23
Line 23 
Line 23 
 #include <sys/ioctl.h>  #include <sys/ioctl.h>
 #include <sys/scsiio.h>  #include <sys/scsiio.h>
 #include <sys/stat.h>  #include <sys/stat.h>
   #include <sys/time.h>
   
 #include <scsi/scsi_all.h>  #include <scsi/scsi_all.h>
 #include <scsi/scsi_disk.h>  #include <scsi/scsi_disk.h>
Line 37 
Line 38 
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
   #include <time.h>
 #include <unistd.h>  #include <unistd.h>
   
 #include "extern.h"  #include "extern.h"
Line 362 
Line 364 
 int  int
 read_track(struct track *ti)  read_track(struct track *ti)
 {  {
         struct timeval tv, otv, atv;          struct timespec ts, ots, ats;
         u_int32_t i, blksize, n_sec;          u_int32_t i, blksize, n_sec;
         u_char *sec;          u_char *sec;
         int error;          int error;
Line 373 
Line 375 
         if (sec == NULL)          if (sec == NULL)
                 return (-1);                  return (-1);
   
         timerclear(&otv);          timespecclear(&ots);
         atv.tv_sec = 1;          ats.tv_sec = 1;
         atv.tv_usec = 0;          ats.tv_nsec = 0;
   
         for (i = 0; i < n_sec; ) {          for (i = 0; i < n_sec; ) {
                 gettimeofday(&tv, NULL);                  clock_gettime(CLOCK_MONOTONIC, &ts);
                 if (timercmp(&tv, &otv, >)) {                  if (timespeccmp(&ts, &ots, >)) {
                         fprintf(stderr, "\rtrack %u '%c' %08u/%08u %3u%%",                          fprintf(stderr, "\rtrack %u '%c' %08u/%08u %3u%%",
                             ti->track,                              ti->track,
                             (ti->isaudio) ? 'a' : 'd', i, n_sec,                              (ti->isaudio) ? 'a' : 'd', i, n_sec,
                             100 * i / n_sec);                              100 * i / n_sec);
                         timeradd(&tv, &atv, &otv);                          timespecadd(&ts, &ats, &ots);
                 }                  }
   
                 error = read_data_sector(i + ti->start_lba, sec, blksize);                  error = read_data_sector(i + ti->start_lba, sec, blksize);

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17