From 71edf5c2d399d712a4bc44bfaaa188f1c99f18ea Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 7 Oct 2009 07:25:40 +0000 Subject: [PATCH] Declared as closed those media which have read errors in the first 64 kB --- libisoburn/trunk/libisoburn/isofs_wrap.c | 30 ++++++++++++-------- libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/libisoburn/trunk/libisoburn/isofs_wrap.c b/libisoburn/trunk/libisoburn/isofs_wrap.c index e3a75fb3..5ec083f3 100644 --- a/libisoburn/trunk/libisoburn/isofs_wrap.c +++ b/libisoburn/trunk/libisoburn/isofs_wrap.c @@ -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; } diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index b6680914..efc325a9 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2009.10.06.071704" +#define Xorriso_timestamP "2009.10.07.072645"