Browse Source

Avoiding repeated PVD read attempts if first reading of PVD yielded error

master
Thomas Schmitt 11 years ago
parent
commit
f860e24e58
  1. 5
      libisoburn/burn_wrap.c
  2. 1
      libisoburn/isoburn.c
  3. 4
      libisoburn/isoburn.h
  4. 6
      libisoburn/isofs_wrap.c
  5. 2
      xorriso/xorriso_timestamp.h

5
libisoburn/burn_wrap.c

@ -1191,6 +1191,7 @@ int isoburn_read_iso_head(struct burn_drive *d, int lba,
int ret, info_mode, capacity, role;
off_t data_count, to_read;
enum burn_disc_status s;
struct isoburn *o;
info_mode= flag&255;
*image_blocks= 0;
@ -1214,6 +1215,10 @@ int isoburn_read_iso_head(struct burn_drive *d, int lba,
}
to_read= (off_t) capacity * ((off_t) 2048);
if(ret > 0 && to_read >= (off_t) (36 * 1024)) {
ret= isoburn_find_emulator(&o, d, 0);
if(ret > 0)
if(o->media_read_error)
return(-1 * !!(flag & (1 << 15)));
if(to_read >= (off_t) (64 * 1024))
to_read= 64 * 1024;
ret = burn_read_data(d, ((off_t) lba) * (off_t) 2048, (char *) buffer,

1
libisoburn/isoburn.c

@ -135,6 +135,7 @@ int isoburn_new(struct isoburn **objpt, int flag)
o->truncate= 0;
o->iso_source= NULL;
o->fabricated_disc_status= BURN_DISC_UNREADY;
o->media_read_error= 0;
o->toc= NULL;
o->wrote_well= -1;
o->loaded_partition_offset= 0;

4
libisoburn/isoburn.h

@ -113,6 +113,10 @@ struct isoburn {
*/
enum burn_disc_status fabricated_disc_status;
/* To be set if read errors occured during media evaluation.
*/
int media_read_error;
/* Eventual emulated table of content read from the chain of ISO headers
on overwriteable media.
*/

6
libisoburn/isofs_wrap.c

@ -482,10 +482,14 @@ int isoburn_start_emulation(struct isoburn *o, int flag)
memset(o->target_iso_head, 0, to_read);
if(capacity > 0 && (off_t) capacity * (off_t) 2048 < to_read)
to_read = (off_t) capacity * (off_t) 2048;
ret = burn_read_data(drive, (off_t) 0, (char*)o->target_iso_head,
to_read, &data_count, 2 | 8);
to_read, &data_count, 4 | 8);
/* <<< was 2 | 8); */
if (ret <= 0) {
/* an error means a disc with no ISO image */
o->media_read_error= 1;
if (ret == -2) {
path[0]= 0;
burn_drive_d_get_adr(drive, path);

2
xorriso/xorriso_timestamp.h

@ -1 +1 @@
#define Xorriso_timestamP "2011.04.14.081721"
#define Xorriso_timestamP "2011.04.22.081847"

Loading…
Cancel
Save