Declared as closed those media which have read errors in the first 64 kB

This commit is contained in:
Thomas Schmitt 2009-10-07 07:25:40 +00:00
parent 259e00f8c8
commit cf046f9533
2 changed files with 19 additions and 13 deletions

View File

@ -307,8 +307,8 @@ int isoburn_activate_session(struct burn_drive *drive)
*/ */
int isoburn_start_emulation(struct isoburn *o, int flag) int isoburn_start_emulation(struct isoburn *o, int flag)
{ {
int ret, i, capacity; int ret, i, capacity = -1;
off_t data_count; off_t data_count, to_read;
struct burn_drive *drive; struct burn_drive *drive;
struct ecma119_pri_vol_desc *pvm; struct ecma119_pri_vol_desc *pvm;
@ -321,18 +321,24 @@ int isoburn_start_emulation(struct isoburn *o, int flag)
drive= o->drive; drive= o->drive;
/* we can assume 0 as start block for image */ /* We can assume 0 as start block for image.
/* TODO what about ms? where we validate valid iso image in ms disc? */ The data there point to the most recent session.
*/
ret = burn_get_read_capacity(drive, &capacity, 0); ret = burn_get_read_capacity(drive, &capacity, 0);
if (ret > 0 && if (ret > 0 && capacity > 0) {
(off_t) capacity * (off_t) 2048 >= (off_t) Libisoburn_target_head_sizE) { memset(o->target_iso_head, 0, Libisoburn_target_head_sizE);
to_read = Libisoburn_target_head_sizE;
if((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, ret = burn_read_data(drive, (off_t) 0, (char*)o->target_iso_head,
(off_t) Libisoburn_target_head_sizE, &data_count, 2); to_read, &data_count, 2);
} else if (ret <= 0) {
ret = 0; /* an error means a full disc with no ISO image */
o->fabricated_disc_status= BURN_DISC_FULL;
/* an error means an empty disc */ return 1;
if (ret <= 0) { }
} else {
/* No read capacity means blank media */
o->fabricated_disc_status= BURN_DISC_BLANK; o->fabricated_disc_status= BURN_DISC_BLANK;
return 1; return 1;
} }

View File

@ -1 +1 @@
#define Xorriso_timestamP "2009.10.06.071704" #define Xorriso_timestamP "2009.10.07.072645"