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

View File

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